Scott
Disable "create another" on form (non modal)
I only want to let users create a single item for a model, but in the form it shows "Create and create another". I know you can disable this for a modal Action, but how do you disable it for a regular form?
8 replies
Dynamically setting a label on a relationship
Hi guys,
I have a table column which shows related sites. It outputs really nicely when doing this:
However, I want to conditionally show a message if no sites have been connected yet. When trying to do this, I get the following error message:
Attempt to read property "sites" on null
Any ideas what I'm doing wrong here?4 replies
How to create another panel?!
Hi guys, perhaps I'm being a bit stupid, but I don't see in the docs how to create additional panels: https://beta.filamentphp.com/docs/3.x/panels/getting-started#next-steps-with-the-panel-builder
So I'd like an "admin" panel where I can manage users, and then a user panel where they can manage their own bits and pieces. I think that's the idea behind panels?
9 replies
Do hidden fields get processed?
Hi guys - I have a "user_id" field in a form. I want this value to be set to the current user, and the field should be hidden from view. Only admins should be able to see and edit this field.
If I hide the field from non-admins, will the default still be set (it's a required field)?
Forms\Components\Select::make('user_id')
->relationship('user', 'name')
->searchable()
->preload()
->placeholder('Select user')
->required(),
8 replies
Primary Color for v3?
Hi guys,
I'm trying to set the primary colour for buttons etc on the new v3. When looking at the docs it says you can use an array: https://beta.filamentphp.com/docs/3.x/support/colors
But I'm getting an error
Filament\Support\Colors\ColorManager::Filament\Support\Colors\{closure}(): Argument #1 ($color) must be of type string, array given
23 replies
beforeSave / mutateFormDataBeforeSave on a Resource (v3)
Hi guys,
I need to execute some code prior to a record saving (both on initial save and update), but I can't seem to find any documentation for v3 which shows how to do this. I've tried doing what is outlined in the v2 docs, but it doesn't seem to be getting called.
I'm adding the beforeSave / mutateFormDataBeforeSave functions in the Resource class for my model.
Any ideas what I should be doing here?
11 replies