File manager - Edit - /var/www/html/spdc/api/app/Rules/BooleanInput.php
Back
<?php namespace App\Rules; use Illuminate\Contracts\Validation\InvokableRule; class BooleanInput implements InvokableRule { /** * Run the validation rule. * * @param string $attribute * @param mixed $value * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail * @return void */ public function __invoke($attribute, $value, $fail) { $isValid = is_bool(filter_var($value, FILTER_VALIDATE_BOOLEAN)); if (!$isValid) { $fail('The :attribute must be an boolean.'); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings