ericmp
Collapse All Table Row Groups By Default
im trying to figure out if there is a way to collapse all groups by default in a filament table with groups + summaries
is it possible? https://github.com/filamentphp/filament/discussions/10717
1 replies
How to debounce entangled x-model?
i created a custom field.
this is how i entangle the state:
but like this i cant get the state when i apply
afterStateUpdated
on my filament form field. if i make it like this (without defer), it works:
but obviously i dont want it this way, since im calling an api and dont wanna call it every second, so this is what im trying now:
but it doesnt work
what im doing wrong??
im checking this docs:
https://livewire.laravel.com/docs/wire-model#all-available-modifiers
https://livewire.laravel.com/docs/alpine#sharing-state-using-wireentangle50 replies
Creating spatie media library collections dynamically
Till now, a user only had one profile pic. But now, for each season (for example on september we start a new season), users have to upload a different profile pic.
I have a Season model, where seasons name, start and end at fields are stored.
Currenty, the user pic is stored in a spatie medialibrary collection -
'profilePicture'
So my question is how to handle this with spatie medialibrary?
I was thinking of creating dynamic spatie medialib collections:
'profilePictureSeason1'
(where 1 is the id of the season)
'profilePictureSeason2'
etc
then, everywhere i need to retrieve the user profile pic ill just use this fn (pseudocode):
getProfilePic(seasonid)
return $this->getFirstMediaUrl("profilePicture{$seasonId}")
What do u think? U think its fine like this or u'd do it different?5 replies
Trouble trying to summarize
in my members table resource im trying to coun how many id_test i have
what im trying:
what i get afaik i go to the table in the frontend:
i've found the issue but idk how to solve it.
my
Member
model uses this as table name protected $table = 'bgcrm.members';
, and i cannot change it. but if i change it to:
protected $table = 'members';
, it works
i cannot change it cuz i need it to make relationships to work when working with relationships between different databases. if i change it to protected $table = 'members';
then some relationships wont work cuz they'll search on their default db database, and i need them to search in bgcrm database4 replies
modalSubmitActionLabel on v2 equivalent?
on v3, in an action, u do:
->modalSubmitActionLabel('hi')
on v2 idk how to do it:
i try:
->modalSubmitAction(fn ($action) => $action->label('hi'))
i get:
Filament\Support\Actions\Action::getModalSubmitAction(): Return value must be of type Filament\Support\Actions\Modal\Actions\Action, Filament\Tables\Actions\Action returned
the objective is to change the submit button label6 replies
Filament v4
im about to start a new project in a couple weeks or little more. the thing is idk if start doing it with filament v3 or delay the start of it a bit to start it using v4 🤔
what would u do?
i think ill start with v3 and then lets see how to update to v4 - i guess wont be a headache
4 replies
How to collapse sidebar in filament php by default
https://stackoverflow.com/questions/78528502/how-to-collapse-sidebar-in-filament-php-by-default
is it possible to achieve?
16 replies
modifyQueryUsing breaks ToggleColumn
in the
app/Filament/Resources/FormResource.php
file i set up the table:
if the user is not admin, i want to show their created forms or the forms they are attached to.
the issue is that when i modify the query, if the user is admin, works just fine, but if the user is not admin, if the user toggles the is_active
column, it toggles the last row being shown in the table!
https://filamentphp.com/docs/3.x/panels/resources/listing-records#customizing-the-table-eloquent-query
i think the issue is related to the or
. why? because if i change the orWhere
to a where
, the toggle works fine, but then the query is not the query i want.
im doing something wrong or it's actually a bug?
update:
i also tried it this way. this way makes the toggles to not change
51 replies
Import csv on relation manager, how to refresh table after importing?
https://filamentphp.com/community/how-to-refresh-widgets-when-table-actions-are-fired
im trying to follow it but applying it into my case.
my case: import action on a relation manager table - refresh the table once the importation has finished
code:
(https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#lifecycle-hooks)
but the table doesnt reload. i guess this is because it depends on the notification that has been sent. so im not sure how to emit it also in the notification or something similar
10 replies
Error when importing
related question: https://discord.com/channels/883083792112300104/1245632711922815066
i upload the csv and all the rows fail. not sure what im missing
csv:
10 replies
How to get ownerRecord inside RecordImporter?
Lets setup 2 models. Event & People. The relationship is n to n.
Inside the edit component of the event resource i added a relation manager - PeopleRelationManager.
Now i started to configure the PeopleImporter so my users can import people into the event they are editing.
The question is, can I somehow get the ownerRecord so i can attach the people imported to the current event?
So far it works (the models are created), but the people arent attached to the event
this is how it looks so far:
now i'm trying to pass in somehow the id of the event, but idk how to retrieve it inside the PeopleImporter class:
13 replies
Grid view loses headers
https://filamentphp.com/docs/3.x/tables/layout#arranging-records-into-a-grid
When i use the grid layout, then the table loses the headers.
In my case, I need to show to the user the field names of the values that are being shown in each record in the grid
for example:
table mode:
in grid mode:
in this grid mode, the user has to remember which field name is which one, otherwise they see only numbers
so id like to achieve something like this:
should i use an infolist for that somehow? what should i do?
19 replies
Eloquent orWhere question
is this part of an eloquent query
the same as this?
the difference is on the first
orWhereDate
/orWhere
the objective is to retrieve the records that their creation date is 1 day ago or 2 or 3 days ago
so all of them are OR but one of them must be true
i've searched it and i understand they are the same, but im not confident it is. what u'd say?15 replies
Way To Use Filters Outside a Filament Table?
I'm in a custom admin panel filament view, and i need to apply filters to the data im showing to the user.
Currently im doing it via applying HasForms & InteractsWithForms to the custom page. then, im using the form as a filter. i dont submit the form, i just await for the fields to be changed and then i apply my sort based on that
the question is, is there a way to bring the filament table filter outside the table so can be used as an independent filter that can be applied to a custom page somehow and not depends on a table?
5 replies