F
Filament22h ago
Code A

How to Display a "New User" Option When Searching for Users in Filament?

I am using Filament's Select component with the searchable() feature to allow searching for users with specific roles. I want to implement the following behavior: 1. Always show a "New User" option at the bottom of the list when searching for users. 2. If the user being searched for is not found, the "New User" option should still appear. How can I achieve this while maintaining the searchable() functionality of Filament's Select component?
4 Replies
awcodes
awcodes21h ago
I don’t think you’re going to be able to do a create inside the select options without a custom component / field but you can do this https://filamentphp.com/docs/3.x/forms/fields/select#creating-a-new-option-in-a-modal
Code A
Code AOP21h ago
Ah, does that mean I have to use the new capital option? Okay, I'll try it.
awcodes
awcodes21h ago
You don’t have to, you are free to do whatever your app needs. But it’s possible out of the box, just not as a select option. But I could be wrong. Just haven’t seen it.
Code A
Code AOP21h ago
okay, thank you very much for the information

Did you find this page helpful?