F
Filament13mo ago
PANC

Is it possible to have two forms with one resource?

I have two types of users but its the same model and database table. For some users, it will only display 2 fields in that form, for the rest it will display the full form... I want to do this with two different buttons How can i do this?
1 Reply
LeandroFerreira
LeandroFerreira13mo ago
wait, if you have the same model/table, you could use Group to show different fields by user type.
->schema([
Group::make([
TextInput::make('field1'),
...
])
->visible(auth()->user()->type === 'group2'),
Group::make([
TextInput::make('field2'),
...
])
->visible(auth()->user()->type === 'group2')
...
->schema([
Group::make([
TextInput::make('field1'),
...
])
->visible(auth()->user()->type === 'group2'),
Group::make([
TextInput::make('field2'),
...
])
->visible(auth()->user()->type === 'group2')
...
Want results from more Discord servers?
Add your server