Filament

F

Filament

Filament is a collection of beautiful full-stack components for Laravel.You can get help using it on our Discord.

Join

When disabling a global scope, does a model policy that uses eloquent take priority?

I have a Post model that has a global scope PostPublishedScope applied. It does literally what the name says: ```php $builder->where( 'published', '=', true) ->where('published_at', '<>', null) ->where('published_at', '<', now());...

Best Approach for Filament Multi-Tenancy with One-to-Many User-tenant Relationship

Hi everyone, I’m new to Filament and want to implement multi-tenancy in my app. In my case, each user belongs to only one tenant/team (so it’s a simple one-to-many relationship). I’d like to use subdomain routing to identify tenants (like tenant1.example.com). However, I noticed in the Filament docs that it mentions a many-to-many relationship needs to exist between users and teams for multi-tenancy to work. Is it possible (and simpler) to implement multi-tenancy with just a one-to-many relationship in Filament, or do I need to set up a many-to-many relationship? What’s the recommended approach for my use case? Thanks!...

How to show image gallery in infolist

how to add image management in infolist

Autocomplete Input Form Field

Can I get an InputText autocomplete, where I can get a bottom Area under the field with specific searched results?
No description

Resource Page outside filament

I have a filament resource and there, there is the getPages method, which registers the routes for the resource: ```php public static function getPages(): array {...

Redirecting to a specific filament resource after authenticating correctly

I have a single panel in my app and I'd like to set first view to a specific resource other than '/admin'' when logging in as a filament user. I don't see anything in the docs that seems to configure this - is this possible? I wish to direct the user to admin/resource_1 instead - any advice?...

extraModalFooterActions

Due to the layout of my project, I have an edit action, but inside that, I have a delete action in the modal footer actions... When I delete the record, it deletes successfully but then redirects back to the edit modal for a record thats been deleted. Is there a dispatch function or anything to manually close the modal/parents?...
Solution:
Oh I found it, was looking at the wrong function
cancelParentActions()
cancelParentActions()
...

Cluster canAccess

Hi all I have been using clusters for a while now and generally put a canAccess method on it to restrict sensitive pages to say a hasRole('Admin') Only through running some tests have I realised that this doesnt restrict the page. It hides it from the navbar, but the pages assigned to the cluster are still accessible if you know the url. ...

call to a member function relation() on null

Repeater::make('offers') ->relationship('offer_order') ->hiddenLabel() ->addActionLabel('Add Offer') ->orderColumn(false)...

How to deal with repeated database calls on forms

Just wondering....how do you chose to avoid repeated database calls when making dynamic forms? For example, take a form that collects payment data for invoices. The select at the top gets the invoice number, and then a number of placeholders with information are driven off that. Including things like invoice lines etc. Then the form checks the payment amount entered and uses a placeholder warning if that doesn't match the invoice balance. ...

SpatieTagsColumn::cacheState does not exist

I get the following error message on a resource index page
Method Filament\Tables\Columns\SpatieTagsColumn::cacheState does not exist.
Method Filament\Tables\Columns\SpatieTagsColumn::cacheState does not exist.
However I am not calling cacheState from anywhere in my codebase....

Year data type

Hi folks, I'm trying to retrieve data from a table where I set one of the columns to have the mysql data type to be Year(). I know Eloquent can handle this because the migration can use ->year() quite happily and it translates well into the table itself. The data then is just various years. However filament seems to think the data held in there is a Unix timestamp and I can't figure out how to retrieve the data as is and not have it be transformed into a full date some time in the early hours of 1st Jan 1970. It seems like it should be a really straightforward thing to do and yet I can't find anything online about this....

How to ignore columns with no header when importing?

I've csv file with lots of columns, some of which have no header or merged header, but I need to ignore them, I only need to import only a few columns with headers or that are not merged cells, etc. Can I ignore other columns? I know I can map columns, etc, but validation fails before I go to this step. - 'More than one column has an empty header '. thanks...

How to: Action group dropdown grid layout

I would like to have a grid layout in action group dropdown in table action group. I have large number of actions in a table row. How to do that.
No description

Drastic performance impact in the UI after migrating to PSQL

We recently migrated from Mysql 8 to Postgres 17, and our Filament UI has slowed down diabolically. Some Form pages take up to 12 seconds to load which is just insane. The table pages are 2-4 seconds. Even with Mysql it wasn't that great but now after the migration it's practically unusable. ...

Disabling ->createOptionForm

Looks like Filament is interpreting a returning null the same as an empty array. I have a repeater in a form that allows on-the-fly creation with ->createOptionForm I would like to disable the Modal Form for existing repeater rows. ```php...

Layout of form inside livewire component not working

I'm trying to add a form inside a livewire component, but the columns just do not seem to co-operate with me... This is the schema: ```php $form ->schema([...
No description

Unable to Display Sub-Navigation for Resources

Hi I wanted to display the Custom pages inside the Resource that I have created unfortunately it does not show up on the Settings Resource, does anyone have an idea why is this happening ?
No description

Sidebar goes to top in SPA mode

I have a sidebar with tons of menu items, when I navigate through them, the sidebar state goes to the top so I have to scroll down back again. Is this a bug?...

Trim Text Inputs

How do I trim all TextInputs before saving to the database? I would've thought this would have been automatic because of the Laravel TrimStrings middleware but I can still added whitespace characters before and after the string and they still save.
Next