mirror of
https://github.com/koel/koel
synced 2024-12-20 09:33:23 +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.');
|
|
}
|
|
}
|
|
}
|