File manager - Edit - /var/www/html/spdc/api/app/Rules/ValidEnumOption.php
Back
<?php namespace App\Rules; use Illuminate\Contracts\Validation\Rule; class ValidEnumOption implements Rule { /** * Create a new rule instance. * * @return void */ private array $options; public function __construct(array $options) { $this->options = getEnumValuesToArray($options); } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes($attribute, $value) { return in_array($value, $this->options); } /** * Get the validation error message. * * @return string */ public function message() { return "O campo :attribute deve ter um dos valores vĂ¡lidos: " . implode(', ', $this->options); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings