if I use createOptionUsing (along with createOptionForm), do I have to validate the inputs manually?
in my createOptionForm I cannot seem to use Filament validation rules for the inputs. Is it because I'm using createOptionUsing?
do I have to call the Illuminate\Support\Facades\Validator and validate manually?
19 Replies
It shoudn't matter as far as I am aware, what error are you getting?
no error, it simply isn't working
->unique(modifyRuleUsing: function (Unique $rule, Get $get) {
ray($get('subject_id'));
return $rule->where('subject_id', $get('subject_id'))->withoutTrashed();
})
I'm also using this same rule in a normal form (no createOptionForm) and it is working.try adding
->fillForm([])
else, refer to what error is shown
what is this used for and where do I add it?
error: Method Filament\Forms\Components\Select::fillForm does not exist.
(same with TextInput)
Sorry wrong chat.
Unique should work, if you DD in the fucntion what happens? or error_log? is it hit?
nothing, the dd is not fired at all
neither the error_log() (I think, I've never used this but placing it in the callback fn before the return is doing nothing)
Can you provide the whole code?
yes, thanks
one sec
goddamnit the message is too long lol
I hope this is fine as well
can you run
php artisan about
and tell me the filament version
v3.2.96
Strange, try moving the creatoptionform to be first, but as far as I am aware it should work
I'd also upgrade to the latest version to be safe