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 change the navigation background color?

The stock navigation color is so plain and not good. How can I change it? and is it possible to put an image in the back of the panel?
Solution:

Reload a subform after select value changes

I have a select that is setting a many-to-many relationship between my room and building records. As there are many buildings with very similar names I want to show a details panel below the select with the main details of the selected building.
I have the select working and the details panel is shown after a selection is made but the vlaues are all empty.
I'm guessing I need to repopulate those fields after the select value is changed but I don't know how to achieve this. Any suggestions on this would be hugely appreciated. I'm trying to paste the code snippet for the select and details section but discord wants to make it an attachment for some reason....

FileUpload

First of all, thank you for the awesome job you've done with this framework. I have a form with a FileUpload control, I would like to delete the stored file once it is deleted from this control, What can I do to resolve this?...
Solution:
Might be better in an observer though in case you need to reuse it. Let the model delete its files instead of the form.

Testing a Table ToggleColumn

I have the following in a relation manager: ```php class SchoolConsentRelationManager extends RelationManager {...

What does `->evaluate()` do?

I see this all over the code base but not really understanding entirely what it's doing. Can someone explain?
Solution:
It handles callbacks that are passed into methods. Ie, if you pass a closure in to something like ->required() the evaluate will run that closure when using $isRequired() in a blade view for example. It also handles dependency injection.

Register email verification on production

I have Google SMTP in my app. Basic forms like contact works well. Problem is when user register into application, he catch notification "confirm email" but this emails are not send. When i run php artisan queue:work its send all verification mails for every users. How to repair / change this?...

npm run build error, run dev not working

Followed the directions I made a new theme
php artisan make:filament-theme admin
php artisan make:filament-theme admin
Followed these steps
⇂ First, add a new item to the `input` array of `vite.config.js`: `resources/css/filament/admin/theme.css`
⇂ Next, register the theme in the admin panel provider using `->viteTheme('resources/css/filament/admin/theme.css')`
⇂ Finally, run `npm run build` to compile the theme
⇂ First, add a new item to the `input` array of `vite.config.js`: `resources/css/filament/admin/theme.css`
⇂ Next, register the theme in the admin panel provider using `->viteTheme('resources/css/filament/admin/theme.css')`
⇂ Finally, run `npm run build` to compile the theme
...
Solution:
Are you using an Adblocker?

Filament Importer Front End Crashes

What is the proper way to chunk a filament importer on the front end with the build-in action? Adding chunkSize to the importer seems to be chunking on the server but if user uploads large files the front end crashes.

CreateAction and EditAction not triggering

I'm kind of lost where I should put my actions. I created a resource named Article by using php artisan make:filament-resource Article I added my form fields etc. but now I want to trigger an action after the creation/edit of a resource. I tried appending(As described in the docs) ->mutateFormDataUsing(function (array $data): array {...

Reactive Field does not persist data

I have multiple reactive fields and all of those fields have badge number value (please see photo). Unfortunately, when one of the reactive field changes, all badge values will set to 0. But when I hard refresh it, correct values are being displayed. May know how can I prevent this?...
No description

Acting As Returning 403

I am trying to create tests for my filament project so I can get higher test coverage. I am starting with a basic page but it is struggling with the auth. I have 2 models for Admins and for Users so have created my own guard, so not sure if that is the issue....
Solution:
Figured it out. It was because my Admin model did not implement FilamentUser
No description

How do i prevent an action modal from closing the modal on submit

How do i prevent an action modal from from closing the modal on submit ->action(function ($action, Order $record, $livewire, $data) {
if ($something) {...
Solution:
$action->halt()

change table action hover behavior

I do not want to have a underline edit button on a hover. Can I change this behavior to make it use slightly lighter color of the button on a hover? Thanks!
Solution:
what about EditAction::make()->button() ?
No description

Is it possible to set same name for some form elements

I'm trying to set the same field name (value) for three different input elements that are displayed based on the selected type. However, I'm encountering an error when I try to select the "Color" type. The code currently works, but I'm unable to display the value for the color and image fields in the edit modal.

Make hidden repeater

When creating a form, I should display only one repeater, depending on the type field in the same form, after which I use ->visible(fn($record) => $record-> === 'value'), but on the final page, when changing the type to select repeater, it changes only after updating the page

How to hide menu under condition?

Hi Everyone, Is there a method to hide the side menu based on a condition? For example, in the user table, I have a social_login column. If social_login has a value of 1, I want to hide a specific menu item (e.g., Settings). Any suggestions?...

Nested repeater not maintaining order

Hi all, I use a repeater inside a builder, in a resource that uses the Spatie Translatable plugin. When I set a order, and save it, all is fine. When I reload and change something else and then save, the order is mixed up....

Toggle Input afterStateUpdated not doing anything

I have my Toggle component and have ->afterStateUpdated just to dd currently, but when I press the toggle button, nothing is happening
Solution:
is it ->live() ?

Is it possible to add a TextAreainput column to tables?

It seems like it is only possible to add a TextInput column to tables, but is it possible to add a TextArea input column somehow? And if not, why not?

Is Filament 3 compatible with MongoDB

I want to create a admin panel using filament 3 Laravel 11 and for database i want to use mongodb