composer require ldc/web-status-checker-laravel remove Old static status checker Fix ImportMedia WIP commands OK many fixes Fix and try to optimize folder component Fix front icons + actions based on icons Favico front fix alert Fix Media upload on depot fix folder component buttons Full front fix with perf due tu vuejs Download medias Navigate within medias superfix Move media + loader isLocked boolean and remove media fix Folder scroll fix arcadia link color red Fix panier show external Tons of fixes back as front REwrited all
36 lines
861 B
PHP
36 lines
861 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
|
|
class IsValidRole implements Rule
|
|
{
|
|
/**
|
|
* Determine if the validation rule passes.
|
|
*
|
|
* @param mixed $attribute
|
|
* @param mixed $value
|
|
* @return boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceBeforeLastUsed
|
|
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
|
|
*/
|
|
public function passes($attribute, $value)
|
|
{
|
|
// phpcs:enable
|
|
if (!\ctype_digit(strval($value))) {
|
|
return false;
|
|
};
|
|
return in_array(\strval($value), config('roles.const'));
|
|
}
|
|
|
|
/**
|
|
* Get the validation error message.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function message()
|
|
{
|
|
return 'L\'attribut :attribute n\'est pas valide.';
|
|
}
|
|
}
|