not updating in this unique rules
please see my code i just want to update but the rules still running and get unique error.
Forms\Components\Select::make('book_name')
->label('Book')
->required()
->searchable()
->options(Book::all()->pluck('name', 'name'))
->reactive()
->rules([
fn (Get $get): Closure => function (string $attribute, $value, Closure $fail) use ($get) {
$volumeName = $get('volume_name');
$validBooks = Section::where('volume_name', $volumeName)->where('book_name', $value)->pluck('book_name')->first();
if ($get('volume_name') !== $volumeName || $value !== $validBooks) { $fail("The {$attribute} is invalid."); } }, ]), Forms\Components\TextInput::make('issuance_filed') ->label('Issuance Filed') ->required()
if ($get('volume_name') !== $volumeName || $value !== $validBooks) { $fail("The {$attribute} is invalid."); } }, ]), Forms\Components\TextInput::make('issuance_filed') ->label('Issuance Filed') ->required()
0 Replies