Andrew Wallo
Help with URL Query Parameters for Table Modal Actions in Filament
I'm working on a project, and I have a specific requirement where I need to attach a URL parameter to a table modal action. My goal is to have the modal behave like it’s controlled by URL query parameters. Here’s the detailed functionality I’m aiming for:
1. Open Modal with URL Parameter: Whenever a link with a specific URL parameter is opened, the modal should automatically open. For example, if the URL is https://example.com/page?openTransactionId=123, it should open the modal corresponding to transactionId = 123.
2. Persist Parameter: The URL parameter should persist every time the modal closes and reopens within the same session.
3. Remove Parameter on Close: When the modal is closed, the URL parameter should be stripped off.
14 replies
Help Needed with Sorting an Accessor in Filament Table
I'm working on a Filament table where I need to display and sort by a computed accessor,
formatted_ending_balance
, in my Account
model. The accessor calculates the ending balance based on account transactions and formats it.
Account model:
Filament table column:
The problem is that when I try to sort by formatted_ending_balance
, I get a SQL error because this accessor is not a database column. How can I enable sorting for this computed accessor in the Filament table? Is it currently possible? Any possible workarounds or similar solutions? Making it a database column is not an option for me based on my app logic. Thanks.9 replies
How to make tenant available to render hooks?
I’m currently building a plugin which allows users to register navigation items for a custom menu in the panel. When creating a tenant by clicking on the tenant register link, I get an error saying the tenant parameter is missing for navigation items registered in the panel using my plugin. It would be very helpful to know how I can go about fixing this. I have already done so much work on this plugin. Thanks.
4 replies
Question about supported relationship syntax in Filament Forms
Quick question for anyone who knows.
Does Filament support saving/creating relationships in a Form using syntax similar to this? Kind of like what you would see for Table columns..
I could have sworn that I remember using syntax like this and it would work..
4 replies
How to Reset the Active Tab in Table
So, I am displaying tabs dynamically, and it works, but when a User deletes all of the records that are "connected", even though all of the tabs disappear correctly and the default table from
index
view is shown, the "connected" active tab query string in the URL is still shown. Setting it to null doesn't work and instead just makes the query string in the URL actually be ?activeTab=null
. Which seems odd.
The only way I could get it to work correctly is by redirecting to the index view URL. Is there a simpler way?
2 replies
Using `getRawState()` returns an array for FileUpload
I use
getRawState()
in order to display previews within my blade view, but the only problem is that while getState()
returns the correct string and URL for a $logo value/state, using getRawState()
doesn't and causes issues. How would I fix this?21 replies
Swap Panel Font depending on database value?
Question. I have a field that allows the user to switch the font used for the Panel. How would I go about switching the panel's font used depending on that value from the database? Obviously, I couldn't do it inside a Service Provider for the panel because the current company instance couldn't be resolved by that time, so I decided to use a Listener.
This works for everything else such as the Panel color, etc... But I couldn't find a way to register or switch the Panels font. Could anyone help me?
4 replies
How do I disable the Auto-saving of Form field relationships?
I currently have a form similar to the following:
The entire form has around 8 fields that all have a relationship. The only issue is that it is absolutely necessary that I use the
handleRecordUpdate()
method to further handle the data and record being saved. I honestly think that it should be mentioned in the documentation that Filament will automatically save the data before you can handle it any further within the handleRecordUpdate()
method since this may cause Users confusion.
But anyways, is there a way to disable the auto saving of relationships for the entire form?
I am aware that I could do this for each field:
But I find this a little exhaustive.4 replies
Customizing the Unique validation rule
How would I appropriately customize the Unique validation rule/method that Filament has according to the following?
Here is my
categories
table:
This is what I have so far for the Field:
Will the above work? Or do I need to do something like this or something else?
7 replies
Trying to delete company: Error "Can't set model as property if it hasn't been persisted yet."
This is a delete action similar to deleting a company in Laravel Jetstream. I get the error; I have to reload the page and then I get taken to the dashboard as my other company.
What does this mean and what do I do to fix this?
44 replies
How do I get this Registration Page to work?
I want to create a company immediately after registration. This should work, but the issue is I get an error: "email is already taken for the email field". I then refresh and get taken to the Tenant Registration page. So, Filament cancels out my DB Transaction somehow.. Even though the user is created just not the company.
2 replies
Overriding Registration Form does not work.
I made a custom page. Literally copied the same content from the Registration form and I get error: "email is already taken".
The email was not already taken. I then refresh the page and then it takes me to the tenant creation page.
2 replies
Reactivity Issue with ColorPicker Field When "id" Attribute from my Model is Present
In my application, I'm using a ColorPicker field to allow users to select a color. Everything works fine until I include the "id" attribute in the data array passed to fill the form. When the "id" attribute is present, the ColorPicker field loses its reactivity. Specifically, after selecting a color from the color pallet, the field does not retain the selected color, and the color pallet does not remain open. The browser console also throws a ton of errors when it is included versus when it is not included.
Note: I noticed this when using:
So I tested this out to see what the problem was, and I have to say this is very weird.
This results in zero errors and the Color Picker is working fine.
This on the other hand makes the color picker lose its selection after the first choice in color (which it doesn't usually do).
Video:
10 replies
Understanding Multi-Tenant Architecture in Filament V3
Hello everyone,
I'm currently working on a project using Filament V3 and I'm trying to get a clear understanding of how multi-tenancy is handled compared to something like Laravel Jetstream's Teams feature.
My application involves a scenario where users can belong to multiple companies (tenants) and switch between them, similar to switching between teams in Jetstream. I'm exploring how to best design this multi-tenancy structure using Filament V3.
Here are a few specific questions I have:
1. How does Filament V3 handle tenant switching in the database? Is there a recommended method to manage this process?
2. How does Filament register, switch, and apply the current tenant in its architecture? Is there any session or user property involved, or does it use a different mechanism?
3. How does the multi-tenancy design in Filament V3 compare to the Teams feature in Laravel Jetstream? Are there any key differences I should be aware of?
4. Any guidance or insights on this topic would be greatly appreciated, especially if you've implemented multi-tenancy in Filament V3 before.
Thanks in advance for your help!
5 replies