Filament

F

Filament

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

Join

How to install Filament tables a Laravel project if it uses Tailwind v4?

Hello everyone. Is there anyone use Filament tables in Tailwind v4? I tried few times but I failed.

Is there a way to allow Split (table layout) to work on all breakpoints?

For example, even if I do ->from('2xl') then it still only works on all BUT 2xl. I want it to work on all and never switch to the traditional layout.
Solution:
Figured it out. I should have been using Stack not Split.

Tenant relations

Hi, everyone I'm working in a multi-tenant panel. I have a tenant that has a many-to-many with leagues....

Select options are not loading along with afterStateHydrated(). whats wrong with my code?

Select options are not loading with model_ids when I'm using afterStateHydrated() to trim these model_ids and format correct JSON. These model_ids are array of foreign key and I want it to be saved as JSON like this "[253,256,255]". ~ Forms\Components\Select::make('model_id') ->label('Vehicle Models')...

Filament layout to livewire component

hi, i've a Livewire component like this: ```php class InviteRegister extends Component implements HasForms...

Newly cloned filament project unable to run

Hi, I'm kinda new to FilamentPHP. And I'm stuck with the installation part. I cloned a filament repo and during installation, I'm getting an error message: "Call to a member function colors() on null". I can't do any php artisan commands because of this error. What I've done so far:...
No description

Cluster, subNav, add the CreateRecord action page to parent

This seems simple enough that I should've been able to search it, but because of the common terms it's not been getting me anywhere. I have a Cluster, it's subNav has two modules, for each I'd like to add a simple "New $record" button under it. I've tried protected static bool $shouldRegisterNavigation = true; in pages/Create$Model.php, as well as Setting the navigationGroup but the Create page doesn't show (although the List page does as per UserResource). Also the subnav isn't respecting collapsible(false) on the navigationgroup::make. Thanks!...

Can you have a "Next" and "Prev" button, inside an Edit page

use case: I wan to edit many records, but I need to enter edit page, click back to return to data table, click record, edit it, click back to return to data table after entering the edit page, I would like to click Next to take me to the edit page of the next record (of the data table) Does this make sense?...

Custom Eloquent query shows wrong data in form() / User role management

I work a lot with user roles. The user role which is assigned to the logged in user has effect on the data and fields that are displayed. So far, it has worked like a charm. Now I have following requirement: Assuming we have the User "Dummy" who has the user role "admin". Inside the UserResource should be a list of all users who - do not have the user role "super_admin" or "admin" - unless it's the own user (so they can update their personal data)....

Table merging Heading and Toolbar

Essentially, I'd like $heading to show in what would otherwise be TablesRenderHook::TOOLBAR_START and headingActions to show in what would otherwise be TablesRenderHook::TOOLBAR_END, for desktop views. For mobile views I'd retain the current split view. Is there a simple way to do that without using renderHooks? Should I be looking at using the custom livewire blade for this level of adjustment? Cheers...
Solution:
Not out of the box that I know, you can create your own version though?

Is it possible to use "create new option in modal" feature with polymorphic select?

I would like to use this feature https://filamentphp.com/docs/3.x/forms/fields/select#creating-a-new-option-in-a-modal with a polymorphic select. But it seems like it is not supported. Is there an alternative method, package, or workaround for this functionality?...

Select::make() get the inner html

Select::make('language_id')
->relationship('language', 'slug')
->afterStateUpdated(function(?string $state, ?string $old) {}
Select::make('language_id')
->relationship('language', 'slug')
->afterStateUpdated(function(?string $state, ?string $old) {}
...
Solution:
would you like to get the label? ```php ->afterStateUpdated(function (?string $state, Set $set, Select $component) { $set('code-editor', $component->getOptionLabel());...

Ordering image does not behave as expected in relationship modal

I have a resort resource with available rooms, and I've implemented room CRUD operations using the relationship manager. My room form is quite tall, with the image input positioned last. When I attempt to order images, the form modal shifts upward.

Create custom page error

Hi! When i want to create a custom page via: php artisan make:filament-page Settings I get the error:...

Scroll to bottom when opening a modal?

Hi all, I have table action to open slide over... ```php Tables\Actions\Action::make('viewDetails')...

Custom Page Table Method Edit Action passing Current Record

Hello, Is it possible to pass current record within view on custom filament page under table method? ```...

Infolist link not clickable

I have added a link to an infolist using the code from the documentation and it there are no errors its just not creating a clickable link. Sure I'm jusrt being dumb but cant see why... Thanks anybody! TextEntry::make('Add Item') ->url(fn (Order $record): string => route('createItem', ['id' => $record])),...
Solution:
```php use Filament\Infolists\Components\Actions; use Filament\Infolists\Components\Actions\Action; .....

Issue with Fieldset Visibility on Form Edit first render

Context: I'm working with Filament forms and have a fieldset (Student Information) that should only be visible when the role field is set to 4. The role is set via a Select field where I assign a role ID. The Problem: - When editing a user with an existing role ID (e.g., 4), the Student Information fieldset doesn't appear on first render until I change the role and then set it back to 4. - I expect the fieldset to be visible as soon as the form is rendered if the user’s role id is already 4, but it remains hidden until the role is selected again....

Test Livewire on a particular resource

Hi everyone. I'm trying to test my Livewire Component who handles user shortcuts to Filament resources. Here a part of my component, where I want to keep the current resource in a computed property. How can I test my Livewire component or the value of 'currentResource' with the context of the current resource (UserResource) in mind?...

Pass data from parent modal to child

Hello, I have a usecase where I want to alert user that a specific action will dispatch unreversable data changes, and he needs to confirm it. For example, a specific department has N services with external role (for example admin on it)....
Solution:
Figured out you can get it from mountedtableactions: ```php ->fillForm(function (Component $livewire) { dd($livewire->mountedTableActionsData[0]); // Need parent data here...
Next