mirror of
https://github.com/koel/koel
synced 2024-11-14 16:37:28 +00:00
17 lines
418 B
PHP
17 lines
418 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use App\Values\UserPreferences;
|
|
use Closure;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
|
|
class CustomizableUserPreference implements ValidationRule
|
|
{
|
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
|
{
|
|
if (!UserPreferences::customizable($value)) {
|
|
$fail('Invalid or uncustomizable user preference key.');
|
|
}
|
|
}
|
|
}
|