mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
19 lines
392 B
PHP
19 lines
392 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use App\Values\UserPreferences;
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
|
|
class CustomizableUserPreference implements Rule
|
|
{
|
|
public function passes($attribute, $value): bool
|
|
{
|
|
return UserPreferences::customizable($value);
|
|
}
|
|
|
|
public function message(): string
|
|
{
|
|
return 'Invalid or uncustomizable user preference key.';
|
|
}
|
|
}
|