Arnaud Lier
Arnaud Lier
FFilament
Created by Arnaud Lier on 6/1/2024 in #❓┊help
TableWidget::$table must not be accessed before initialization only on mobile
The table method of my TableWidget is only called when changing a select page filter on desktop (Firefox), not in my mobile browser (Firefox) and results in the $table property not being initialized in the table widget view. Any ideas?
3 replies
FFilament
Created by Arnaud Lier on 8/30/2023 in #❓┊help
Disabled select field with default not taken into account when creating record
Hi! 👋 I've just upgraded to Filament v3 and the experience is amazing so far! 😄 Only one little hiccup: one of my select fields doesn't work anymore (probably because I didn't really searched for how it works under the hood...) Here is my field definition:
Forms\Components\Select::make('team_id')
->label(__('Team'))
->relationship('team', 'name')
->default(Auth::user()?->currentTeam?->id)
->disabled()
->required()
Forms\Components\Select::make('team_id')
->label(__('Team'))
->relationship('team', 'name')
->default(Auth::user()?->currentTeam?->id)
->disabled()
->required()
It allows the user to see which team the record is going to be created under. Saving the record into the database fails because the insertion isn't provided with the team_id. It worked on v2 for some reason. Is there an "idiomatic" way to make it work? I can just force it into the insertion query of course but wanted to know if there was a "better" way. Also, if it's disabled, could the user forge a request modifying it or it's fine without a check on my end? Note: this field is in a wizard and it doesn't work without the ->relationship either.
7 replies