Prodex
Weird override behavior
Hi, I'm overriding the Shield resource, so I don't have to publish the stubs. But I just don't understand why some methods can be overwritten but some others not.
For example: I can easierly overwrite shouldRegisterNavigation() or getNavigationLabel(), but I can't overwrite getPluralModelLabel().
Both getNavigationLabel() and getPluralModelLabel() are used the same way in the base Shield resource. But only getNavigationLabel() works, the other method (getPluralModelLabel) doesn't even get called.
Can someone explain to me, why this is happening?
Full code:
For reference, this is the shield base class resource:
3 replies
First Action Modal doesn't close
I've implemented a delete action for the
editOptionForm
like so:
But the confirmation modal for the delete action is behind the edit modal, because the edit modal doesn't close. Even when using cancelParentActions
.
How can I make it, so the edit modal closes?
Thank you!1 replies
Cache Action (Modal) Response
Hi,
is it possible to cache the response of filament table actions (modals) for a certain amount of time?
Background: I've got a project that has a page which can experience a lot of traffic and I would like to keep the responses as tiny as possible. Because livewire makes additonal requests when a modal gets shown, I want to improve that as well.
2 replies
How can I avoid N+1 problem in custom views?
As described in the docs I use a custom view for a table column and I'm using $getRecord() to access the eloquent model.
This however makes an N+1 problem, because for every record displayed in the table the $getRecord() method retrieves the data from the database again.
How can I avoid this? Thank you!
5 replies
"Remember Me" with Socialite
When using Socialite, how should "remember me" work? If "remember" is set to true in
Auth::login()
the cookie gets set, but after the normal session times out, the middleware "AuthenticateSession" checks if a password hash is present. Because there's no password hash when using socialite, it always falls back to ->logout()
.
Anyone knows how to handle this correctly, without logging the user out?1 replies
Include JS Asset: "Identifier X has already been declared"
If I include JavaScript like the docs say, it doesn't bundle it through vite, so this doesn't work:
If I use the Vite facade it does load the correct file, but I get "Identifier X has already been declared", because vite doesn't know, that there are other assets as well.
How can I avoid this problem?
3 replies
Collapsable column, but keeping the normal layout
Hi,
is it somehow possible to have a column that is below the row which can be collapsed to add extra information, but keeping the "normal" layout (where each column has a title / label above)?
If I use split() or stack(), it messes up my table and more importantly: the labels are gone. But in my case, I still need those.
Thank you!
3 replies
Calling Action Modal from parent livewire component
Hi, I'm having a "card" livewire component that's inside a loop from the parent component. The card component has a delete action with confirmation.
The docs say the <x-filament-actions::modals /> needs to be in the same component as the action and that's true. However, if I do it like this, a modal gets rendered for each card, instead of just having one.
Is there any better solution for this? Like calling the modal from the parent?
9 replies
Sub Navigation in ListView for Custom Page
Hi, I want to display a sub navigation in the ListView for a custom page (which does not interact with any record).
I have a subnavigation for my records setup already in my CustomerResource:
But how can I display a sub navigation on the ListCustomers Page for a custom Page?
Thank you!
4 replies
QueryBuilder Filter returns nothing
Hi,
I have this simple RealtionshipContraint in my filter querybuilder. The items of the relation is displayed correctly in the select, but if one item is select with "is" operator, it doesn't return anything.
To double check: It disabled / removed all other filters to avoid possible conflicts. But it still doesn't work:
"is empty" and "is not empty" works.
The relationship itself works too, when it is used in other filters or fields.
Can anyone help?
4 replies
Multiple columns of same attribute
Hi,
how can I use the same attribute multiple times in a table? For example:
I have a invoice table, which has "month" and "year" as column, but the data comes from the "date" attribute of the model, just with a different format.
Thanks!
3 replies