ldc-dam/app/Rules/IsValidRole.php
Jérémy Munsch 9767e62c72
Update NPM deps and webpack.mix.js
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
2022-07-22 17:00:48 +02:00

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.';
}
}