mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 10:24:45 +02:00
Fix rule validation?
This commit is contained in:
parent
c5b441e54a
commit
615b70f9a2
@ -252,13 +252,13 @@ class EditServer extends EditRecord
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('variable_value')
|
||||
->rules([
|
||||
fn (ServerVariable $variable): Closure => function (string $attribute, $value, Closure $fail) use ($variable) {
|
||||
fn (Forms\Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
|
||||
$validator = Validator::make(['validatorkey' => $value], [
|
||||
'validatorkey' => $variable->variable->rules,
|
||||
'validatorkey' => $get('rules'),
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$message = str($validator->errors()->first())->replace('validatorkey', $variable->variable->name);
|
||||
$message = str($validator->errors()->first())->replace('validatorkey', $get('name'));
|
||||
|
||||
$fail($message);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-theme="{{ config('scramble.theme', 'dark') }}">
|
||||
<html lang="en" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
Loading…
x
Reference in New Issue
Block a user