2f3fd laravel 11 upgrade (#436)
* fix password reset bug * upgrade to laravel 11 * composer.lock * fix migration issues * use ValidationRule Contract * rename password_resets table * implemented casts as protected function * update env variables * fix optional property * fix validation issues * use <env> on php unit xml * fix pint * cmposer.lock * composer json fixes * fix composer dependencies, remove faker * remove unused class * remove test class * fix default value for mysql migration * linting * expression syntax fix --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace App\Rules;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
|
||||
class ValidPhoneInputRule implements Rule
|
||||
class ValidPhoneInputRule implements ValidationRule
|
||||
{
|
||||
public ?int $reason = 0;
|
||||
|
||||
@@ -27,6 +28,13 @@ class ValidPhoneInputRule implements Rule
|
||||
}
|
||||
}
|
||||
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
if (!$this->passes($attribute, $value)) {
|
||||
$fail($this->message());
|
||||
}
|
||||
}
|
||||
|
||||
public function message()
|
||||
{
|
||||
return match ($this->reason) {
|
||||
|
||||
Reference in New Issue
Block a user