*
Inserting pivot data without RelationManager
I have a multiple select on an edit page, has a
belongsToMany()
relationship.
I want to inject something to be saved in a column in the pivot table.
I found out that the relationship is saved in HasState::getState()
, but could not find a way to inject additional data to it.
Tried mutateFormDataBeforeSave()
in the EditThing component, but that gets called after getState()
, so no effect.
Any help would be appreciated.14 replies
using hiddenOn and hidden in conjunction
Currently, there's no way of achieving this, as the last chained call will override the previous.
something like this, quite understandably will not work:
What I'm trying to achieve is, hide a tab in a form on
create
, and on edit
, have a closure to run some custom logic to hide or show it.
The only solution I can think of is duplicating the code for the hiddenOn
method in the hidden
closure, which is less than ideal.
Any suggestions on how to tackle this?5 replies
Testing select field options
I've implemented some logic to update the query in a select field using
modifyQueryUsing(closure)
Is there a way to test this logic?
Maybe using a closure with assertFormFieldExists()
?
Like...
I've attempted to get the options using the $input
closure param above with no luck.
Note: My select is multiple()
and has preload()
Any help and/or insight appreciated.10 replies
formatStateUsing() and a nullable boolean column
I have a nullable boolean column in a table like:
In my Filament table, I'm trying to display 'Pending' for the null value and 'Accepted' or 'Rejected' correspondingly for
true
and false
I do not get any $state
or Model $record
for the null values at all.
will not dump anything at all, but works as expected for the non-null values.
same with
Any insight would be appreciated.12 replies
What is the best way of applying custom middleware to the registration page?
I want to apply one of my own middleware classes to the registration page after adding in
->registration()
in a panel service provider.
Tried adding in the HasRoutes
concern in a registration page component which extends Filament\Pages\Auth\Register\
and implemented getRouteMiddleware()
and routes()
with no luck.5 replies