code jam
child resource as a dialog on click of a custom action button?
Time & again, I am coming across this pattern as a requirement and not able to solve it.
I want to give a custom action button per record in the resource list view to pop open a dialog to add a new child record associated with this parent record.
E.g. we have a support ticket system. It has a ticket resource which lists all the tickets. Next to each ticket row, I want a custom action to add "add comments" to the ticket about its progress.
Ideally, it should pop open a dialog and have fields to capture comments and user who is adding this update/comment for that ticketID.
I don't want to click on the ticket to view the ticket and it's comments relationship (via relationship manager) and then click on add in the relationship to add a new comment!
How do we achieve this pattern? Is there any code reference where this is done for my reference?
Maybe this pattern should be documented because I feel others too would be facing this requirement.
Thanks.
3 replies
multiple panels on single dashboard as tabs?
Wondering how/if we can have multiple panels visible on a common dashboard for easy navigation!
Instead of having example.com/admin, example.com/booking, example.com/billing etc, we have example.com/dashboard which has individual (horizontal tabs) for admin, booking & billing. Ability to control the tab visibility (& access which anyways is handled in the panel) with roles/permissions would be important. Managing it using the usual permission package or think of something like feature flags (thinking more from a SAAS angle where one customer gets booking, other gets billing etc) perhaps?
Any alternative ideas or suggestions? Thanks.
9 replies
how to change the look & feel of repeater field?
The repeater field occupies too much screen real estate and I would prefer to change its appearance in terms of
a. Removing the titles in each repeater entry and have it only on the first one
b. Removing the additional header section which holds sequence buttons & delete icon and have them on the same row of repeater fields
c. Ability to manage the margins/padding around the fields to make it look compact.
How to go about making these layout changes for this field?
Please guide.
7 replies
Livewire charts: how to add to custom page?
I am looking at adding livewire charts (https://github.com/asantibanez/livewire-charts) to my custom filament page.
The custom filament page is the default page created using the 'artisan make:filament-page' command and its blade is extending the filament page layout.
This asantibanez/livewire-charts package expects us to add @livewirechartsscripts directive to the layout alongside the livewire scripts.
In the livewire 3 & Filament php 3 context, where / how can we add this scripts directive? (No need to add livewire directives anymore).
Or is there any other charts plugin which I can easily add to the custom page?
Can someone please guide?
3 replies
how to persist filters beyond the session?
Users would like to persist their settings aka filters (in this case) even after logging out, so that they get the same settings when they log back in next time.
How can we persist user specific filter settings for good in a cookie or local storage settings?
https://filamentphp.com/docs/3.x/tables/filters#persist-filters-in-session
3 replies
form as a table? store to a json column?
To explain with an example, I have a small (4) list of products.
I have an InvoiceResource to capture the customer details, etc. For adding the ordered items (products), we don't want a repeater field, but want to display all products in a table and provide text input next to the products / rows for entering the quantity. Each item will have a default quantity of 0, and the user will update the needed quantity accordingly. (Some rows can remain as zero quantity) - basically the old school way of creating a form table. Once the 4 rows are filled, I would like to store the item name & quantity into a json column. I looked into the documentation. Looks like the repeater field won't help here. Please correct me & guide me on how to do it with a repeater field? (an easier, quicker, cleaner approach) PS: I am tending towards creating a custom field for this. Note: 4 products can become 6 later. So it has to be dynamic
I have an InvoiceResource to capture the customer details, etc. For adding the ordered items (products), we don't want a repeater field, but want to display all products in a table and provide text input next to the products / rows for entering the quantity. Each item will have a default quantity of 0, and the user will update the needed quantity accordingly. (Some rows can remain as zero quantity) - basically the old school way of creating a form table. Once the 4 rows are filled, I would like to store the item name & quantity into a json column. I looked into the documentation. Looks like the repeater field won't help here. Please correct me & guide me on how to do it with a repeater field? (an easier, quicker, cleaner approach) PS: I am tending towards creating a custom field for this. Note: 4 products can become 6 later. So it has to be dynamic
4 replies
how to change text-gray-950 to something else globally?
If we change the 'primary' color in the panel, only the amber gets replaced with the new color. The menu options in the side bar, the button backgrounds etc change from amber to the new color.
However all the other text on the screen, like Dashboard or the text in the widgets or in the user profile dropdown etc continues to remain dark-grey (text-grwy-950).
How to change this dark-grey color of text to a different color?
6 replies
repeater field - giving array to string conversion error
Trying a simple invoice and invoiceItem combination for repeater field.
When trying to create the record, it throws array to string conversion error.
Any quick tips on what is going wrong? Have followed the examples available.
2 replies
Update 2 models using a single form? (with transaction)
I have two models, Order & OrderContent. (And a third, Stocks).
Order contains the summary of the order and OrderContent will hold multiple rows for each item in the order - typical invoice setup.
I want to capture the order and it's content in a single filamentResource using a wizard form, first tab capturing the order and second tab capturing the content (repeater fields).
How to save the contents of this form into the two tables using transaction? Also, add validation to OrderContent fields by querying a third table, Stocks?
I was thinking of handling it in mutateBeforeCreate(), but I won't be able to perform the transaction. So, I guess I should override the createRecord completely and write my own create function for this resource. And add custom validation for the fields individually using stock availability.
Is there a simpler way? Any examples please..
Thank you.
5 replies
NavigationGroups: two level?
Question 1: is it possible to add two levels of Navigation groups? (Rather multi level groups)
E.g.
Settings
-> User Management
--> Accounts
--> Roles
-> Locale Management
--> Language
--> Currency
Question 2: what is the advantage of defining navigation groups in the panel config (service provider)? (Other than being able to associate an icon to the group & making it collapsible)
We can already configure group in the resource.
I have added the groups in the panel configuration, they don't appear in the sidebar. Why do we need to add the NavigationGroup in the panel config?
4 replies
multi tenancy with Filament V3 & stancl/tenancy package?
How does the current multi tenancy / context which is baked into V3 work alongside the stancl/tenancy package?
Admin panel will be with filament (for admin actions), but regular user functionality is outside the /admin route and is using stancl/tenancy at the moment for achieving multi tenancy.
How to handle this approach of using filament V3 for admin (managing settings etc) while the user application continues to use stancl/tenancy?
My mind is fixated on using only one - either filament V3 or Stancl/tenancy - to handle the full multi tenant application, but I also want to take advantage of the rapid development with Filament & the 'nice'ities / features of stancl/tenancy package.
What is the easiest way of going ahead with here? Please suggest.
10 replies