HL
In my table's getEloquentQuery() method should I eager load relations?
I know if I use the dot notation like
TextColumn::make('game.id')
it will automatically eager load, but if I do this:
with the details relation, should I eager load the details
relation in the tables getEloquentQuery() method? Should this be a common practice?5 replies
Updating Dashboard filters doesn't update ChartWidget-s
The new v3.1.0 dashboard common filter function (https://filamentphp.com/docs/3.x/panels/dashboard#filtering-widget-data) only works on BaseWidget-s perfectly.
If I use it on a ChartWidget, the chart itself doesn't update on UpdateFilters. I can see the values change in the livewire component, but the chartjs itself doesn't. If I refresh the full page, it updates correctly.
6 replies
InteractsWithPageFilters doesn't refresh the Widget on filter change
My Dashboard.php and my Widget is all set up correctly to use the new v3.1.0 dashboard filter function. In my widget file with DebugBar I can see that $this->filters change correctly, but for some reason the widget itself doesn't refresh. Once I refresh the full page, it displays the correct filtered data.
The docs say: "When the filters are updated, the widgets will be reloaded with the new data."
I believe there is a bug with this part.
11 replies
Modify SelectFilter query based on another SelectFilters value (Dependent Filters)
I have these 2 filters
( in my app:
I want to make the 2nd filter so, that it only queries the servers, which are selected by the first selectFilter, or otherwise show all.
I can do that with custom filters, but is there some out of the box solution for this?
14 replies
->recordUrl global setting not working
For some reason, if I use ->recordUrl(false) in the AdminPanelProvider, it doesn't work, but it works separately in the Resource.
All my columns are striped so that part is working, and again ->recordUrl(false) works if I put it in the resource's table function, so I'm not sure what I'm missing.
12 replies
Set dark mode on by default
Is there a way to set the theme localStorage variable to 'dark' by default for everyone, instead of 'system'?
My website has a dark color, not switchable. If someone has light mode in the system, and tries to log in, it would blind them permanently 😄
Of course if it's not possible, I'll edit the base bg colors in css to dark ones, but would be nice to still have the light mode option, although not as the default.
13 replies
Filter value=null error after refreshing page
I have a simple filter in my Resource's table:
I open the resource table from the url:
http://127.0.0.1:8000/admin/all-orders
This sql query runs:
All good.
Now I set the filter once to something
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=1
I refresh the page, still all good
Than delete the filter, and get to this url:
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=null
I refresh, and no result are shown and this sql query is run:
The service is always an integer, can't be null.
Is it the intended way for the url query to switch to null, in case I delete the filter?
I noticed, that this isn't the case when I never refresh the site, that is what's causing the problem.
9 replies
->relationship() with hasOneThrough() relation doesn't work anymore
Hi guys, in my Account model I have this relation:
In v2 I used this and it worked perfectly:
Now it gives me this error:
Filament\Forms\Components\Select::getRelationship(): Return value must be of type Illuminate\Database\Eloquent\Relations\BelongsTo|Illuminate\Database\Eloquent\Relations\BelongsToMany|Znck\Eloquent\Relations\BelongsToThrough|null, Illuminate\Database\Eloquent\Relations\HasOneThrough returned
Is there a way to solve this without manually giving options and a query method myself, like it used to be?
5 replies