Bagus A
Change table row background color based on hexadecimal
I would like to show rows on a table where each row will have it's own color from database. The color is defined using hexadecimal, as far as I know FIlament only able to use tailwind color, if it's defined customized from database, is it possible to change the row background color?
1 replies
Go to page X by default on table resource page
I have a table with custom pagination where each page is divided by the number of week of this year. Let's say today is week 50, I want to go to page 50 directly whenever I open the resource table. Is it possible?
Thanks in advance
1 replies
Customize create label for Resource with ManageRecords
In normal resource with it's own create page, we can have
getCreateFormAction
method to customize the label of the create button, for example:
This method doesn't work for simple resource which extending ManageRecord
without it's own create page. How do we customize the label in simple resource?1 replies
How to apply default filter/query for a table
I have one table in DB that I would like to display on two resources based on it status.
This might be achieved using filters, but filters can be changed and I want a dedicated page for some reason.
I only find a way to enable default filter (https://filamentphp.com/docs/2.x/tables/filters#default-filters), but this is not what I'm looking for.
How do we apply default filters by code without visible UI?
3 replies
Select Filter with Group By from Column not Relationship
I would like to create a SelectFilter using a column in a table. It's not a relationship so I need to do a query and pluck the name but the options field only accept hardcoded arrays.
How do I query the fields inside options method?
4 replies
How to combine text and badge?
In displaying as a badge of Text column in Table (using
->badge()
) will turn the whole text as a badge. How do we combine a Text column to show a text and a badge:
123 <low>
where low is displayed as a badge while 123 as a normal text.2 replies
Show Image in InfoList
In infolist builder, we have an option to show image.
My issue is that I don't save the image on the database. I will use an image uploaded to the public folder with filename of the code column.
In normal blade, I'm going to render it with
How do I achieve this in InfoList card?
8 replies
Editable relations in ViewPage with InfoList
So, by default I got EditPage from a Resource allows me to edit it's RelationManager.
Because I only need to show static data, I use InfoList and a ViewPage. But, inside this page, I still want to be able to edit the RelationManager (not the Resource owner data). How do I achieve this?
1 replies
How to know what arguments available inside a function?
I'm sure it's not Filament only question, it might closely related to the PHP itself.
For example, I would like to pre-process the data before saving it to the database. In this case I need to use
before
lifecycle hook for a CreateAction. I want to know how I can get the current form data inside this callback.
Documentation example show the function without any arguments.
While, other example show it with two arguments
If I use my text editor to see inside before declaration inside HasLifeCycleHook.php
it only has Closure.
I still don't understand how do I realize that any function in Filament can receive what kind of data?
Appreciate every information. Thank you guys.3 replies
Can I create two modal edit form with different fields?
If I have 4 fields in create form, A B C D.
In the table, I would like to have 2 actions, "Edit Information A", "Edit Information B".
The first action will only show a modal form with A B fields while the second action only show CD fields.
How can I achieve this?
3 replies