CT
How to increase SelectFilter's dropdown width?
For anyone in the future I added the following CSS which works;
It has one issue which is that if the content in the dropdown has a large width it can expand off the screen (particularly if this is on the far right side). I'm guessing we would need something like popper to fix that issue.
3 replies
How to add an ->orderBy() *after* all other orderBy's? Or modify query *after* query is built?
For anyone finding this in the future I came to the conclusion that there is no way to solve this in Filament, I could not find a way to hook into filament after the query is built, but before it is executed.
So I solved it by extending the Eloquent Builder.
and in each specific Model that needs this behavior I added this;
I don't really like this solution but I could not find any better way to do it.
3 replies
Loosing a really good project because of the slowness in loading components
Sorry to interrupt/hijack but what are the exact improvements in v4 that will help with this? Is it for repeater only, or is it more general improvements to performance/loading? I remember reading something about livewire partials, is it related to that?
43 replies
Correct way to add/create a Livewire table column component?
Ok I managed to find a solution which works and gives no livewire key errors. It's kinda hacky, so if anyone can tell me the proper way it would be appreciated. What I ended up doing is keeping the TextColumn as is, then making an Action and calling that action. Like this:
inside
components.score
:
and finally the action like this:
I tried to directly call ->action('score-modal')
on the TextColumn, but it would return an error saying that score-modal
doesn't exist on ListSites
(my filament resource).3 replies
Better performance?
Maybe I've misunderstood something but all the caching would just be dictated by the browser + Google's cache headers, no? From what I can see swapping to
GoogleFontProvider
only changes the URL you grab the font from?
You're still doing a request to Google always, nothing locally?73 replies
Better performance?
sounds to me like a simple DNS issue... normally when timeouts are exactly 5s or 10s that's the problem, hence why switching to Google fixed it. So it's not really a Filament issue I would say. Bunny already uses
font-display: swap
but that only matters for the secondary request - if you can't access Bunny at all then it's irrelevant. So perhaps using the media print trick would fix this. It looks like this;
Would that be useful if I submit a PR or nah? Most of my projects I add that in anyway to speed up the first paint.73 replies
Correct way to apply a `withCount()` and `->having()` in a SelectFilter?
Solved. For anyone else wondering in the future this was the only way I could get it working. I was unable to get
->having()
working inside of ->modifyQueryUsing()
alone.
->options()
returns an array of site counts, eg [0,1,2,3]
ctype_digit()
was necessary because most casting doesn't play nicely with the string "0"
modifyQueryUsing()
is necessary to remove the where condition that filament applies by default, ie WHERE sites_count = 0
4 replies
How to correctly override the table container blade view?
Solved: I was being dumb and copied the container component naming scheme by accident
<x-filament-tables::container>
but instead I should have kept the same naming as the file I copied, so I was overriding the wrong file (this is just a container around the component). Correct placement was resources/views/vendor/filament-tables/index.blade.php
3 replies
Update hidden fields (Relationship)
$set()
itself "works", as in I could change the value to null, then verify and get back the same null using $get()
but it simply doesn't save to the database, it would always skip any hidden fields if you get what I mean?12 replies
Update hidden fields (Relationship)
Funny timing, I just had a very similar issue I solved yesterday. Basically hidden or non-visible fields are not updated (even if you manually update the values with for example using
$set
and/or using ->dehydrated()
).
I solved my issue by doing this;
I'm happy to submit a PR later to the docs but I'm not even sure if this is expected behaviour or not? Is it supposed to work when using ->dehydrated(true)
@Dennis Koch ? Actually, aren't all fields ->dehydrated(true)
by default? There is also a ->dehydratedWhenHidden()
method which I played with but was unable to get working, same behaviour12 replies
Help me choose: Filament or Nova
I have used Nova in the past for both small and medium size projects... after the first week of using Filament I decided it's objectively much better. But as tygoegmond said you're not going to get people on a Filament server telling you to use Nova...
8 replies