Benjamin
Table filters : column not found, why ?
For example here, why the
$query
is a neutral Builder
(same as doing User::query()
) and not the same query of the table that is used to fill the table, in $table->query()
? Does it mean that, for each filter, it makes another SQL query and then filter the table by IDs comparison ?
7 replies
Table filters : column not found, why ?
No, I make a
joinSub()
and an addSelect()
in the $table->query()
method. Accessor could work, I thought about it but was concerned about the performance. With an accessor, it will make one additional query to the availabilities
table no ?7 replies
Struggling with SelectFilter with relationship() and distinct status (Enum)
I foud similar issues (https://github.com/filamentphp/filament/issues/12948 + https://github.com/filamentphp/filament/issues/10086), and I finally used a custom filter :
3 replies
validate() vs getState()
Okay, so if I don't want to save some data in my database, I should call
getState()
and manually remove them from the array, even if the components are ->hidden()
? 🧐
My hope was to just use ->hidden()
on some components conditionally to not save them later.8 replies
Does @livewireScripts directive still need to be included when using @filamentScripts?
Oh okay, this code was not working :
If I remove the comments it works. And I think
@livewireScriptConfig
is not need either because if I add it then it doesn't work @awcodes : https://filamentphp.com/docs/3.x/notifications/upgrade-guide#javascript-assets8 replies
Enum select with live() on Create and Edit form
Great solution @sadiqgoni13 ! On my side, I only use string back enums, so I made something similar but using a
FilamentService
with isEqualEnum()
method :
And then in my form I inject the service with the boot()
method :
And use it like that :
In this example, the ethnicity_details
field is visible only if ethnicity
value is EthnicityEnum::OTHER
.7 replies