how to not show return option when condition not fullfill
i want if not fulfill the condition it not enter the option, but in here it show the id, i want only not fulfill the condition appear in the option

5 Replies
This method is for preparing the label of the option. You have to do the condition in either
->relation()
or ->options()
you have used.can you tell me how to do it using ->options()?
Using options():
->options(fn () => Student::where('nim', 'not like', 'D121%'))->pluck('nim', 'id')
Using relation():
-relation('student', 'nim', fn ($query) => $query->where('nim', 'not like', 'D121%'))
ahh i see, it works, thank you for your help
You're welcome