Filament

F

Filament

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

Join

Custom button

Hello, I don't know this editor, but is there a way to add custom button?...

Don't dehydrate hidden field in Repeater

I have a Repeater field that has a selection for languages. When the selected language is English, I'd like to show some fields, hiding those fields for any other language selection. Issue is that when my form is saved, the hidden fields are populated with null values. How do I avoid this? I don't need them saved.

How to add helper text on global search

I want a helper text on the global search field. But i tried to apply several different approaches it didn't work out. Note: - i tried to add these solution in the table section code. - ->searchable() i have user this on the form fields....
No description

$this->form->getState() empty

Hi, I've created a Filament page with the make command and I've placed a form inside the component. When I submit my form, $this->form->getState() returns an empty array and I'm not sure why. The $data property however is filled correctly, and my validation also runs fine. Any idea what's wrong with my code? Or shouldn't I use $this->form->getState() and just use $this->data? My file: ```php class VolunteerSettings extends Page implements HasForms...

Sum of 2 columns of a relation

I have a model Order which hasMany orderPositions. A order position contains the columns product_price and amount. How can I now show the "value" of an order in a table. With value I mean the sum of all orderPositions prices times it amounts. I tried to use the aggregate functions:...
Solution:
Nevermind, found it: ```php TextColumn::make('order_positions_sum_product_price') ->money("EUR")...

Assistance with Deploying Laravel 11 & Filament v3 Admin Panel in Subfolder

Hi, I've deployed an admin panel built with Laravel 11 and Filament v3 on my development server, and everything is working fine. However, for production deployment, I need to place the admin panel in a subfolder instead of the root directory. Current Setup:...
No description

Filament::auth()->login($user), multiple guards

How does Filament::auth()->login($user) deal with issue where there are multiple panels and guards? Looking from a testing perspective, can I specify the guard to use?...

I want to move the table filters on the left

Is possible to move the filters on the left side without hacking the published file?
Solution:
fyi it works with
.fi-ta-header-toolbar.flex > .ms-auto.items-center {flex-direction: row-reverse ;}
.fi-ta-header-toolbar.flex > .ms-auto.items-center {flex-direction: row-reverse ;}
...

Filament preloaded css and my tailwind vite compiled css conflict.

Hi, I have a strange issue. When I run "npm run build", my css are generated and it kind of overrides filaments base theme css. For example: Header div class list: "fi-header flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between". It looks very good, but .flex-col from my generated tailwind css file overrides "sm:flex-row" class. But, if I run npm run dev. Then every thing looks as it supposed to be. Does anyone knows what could cause the issue?...

Custom widget action steps

So I created an custom widget so that an user knows if he should pay this year or not. With the ->url() it redirect correct. But know I want to do it with steps> When I use the steps nothing happens when I click on the button. - When I don't implement the interfaces I this error Public method [mountAction] not found on component. - When I implement the interfaces nothing happens when I click on the pay button. No error in the console. Just the loading spinner on the button and that's it....
Solution:
Fixed with: Action::make('payNow) instead of Action::make('Pay Now)

Live chat Component and functionality

Hi, I need to implement a live chat functionality on my filament app. I've CoustomerSupportResource and I want to build Livewire page/component to display the chat tab in Form/Edit Page The chat should be from user to admin (tow model), not general (never general). I'm wondering what I should go about implementing this? ...

Unit test problem in a ViewRecord resource

I'm trying to implement unit tests on a custom ViewRecord page that I created for my Order resource. I cannot understand why, but Filament is unable to retrieve the model I just created in my tests. It's not consistent, but my tests fail one time out of two... Here an exemple of one test : ```php...
No description

Ovverride Postresource of the Fblog plugin.

Hi.. I'm trying to ovverride the Postresource with my own customPostresource to add new fields but it is not getting ovverrided. I have tried adding the FilamentServiceProvider and then register my postresource bir still pervious resource is only coming. I am using the plugin Fblog by firefly to implement the blog feature in my project....

Compressing pdf file before saving

Is filament have features where compressing big files lang pdf? I try to compress in acrobat it works but its another process

Can you add a custom css class to a form component (like a toggle?)

I have a form inside a grid that all the toggle buttons are aligned to the top - I'd like to have the toggle compnent align vertically with textinput elements in the same row. Is this possible?...
Solution:
->extraAttributes(['class' => 'custom_css']) ->extraInputAttributes(['class' => 'custom_css'])...

Disable `?page=....` query string params for a table

Hi all. I have a table in a modal that's adding pagination query params to the url. I know I can use ->queryStringIdentifier() to avoid conflicts but I'm hoping to disable it entirely. Any idea how I could do that? Cheers...
Solution:

How do I validate richtext editor images?

Hello Filament Team, I'm Rifat, a Laravel developer. Recently, I've been working in tall stack environment. So now I would like to add filament richtextEditor in my application, and the fact is I can't set up the validation rules, and sometimes when I remove an image and add a new image from the editor, the previous image isn't deleted from the disk! Thanks in advance!...

Can't add scripts to admin panel service provider

I tried adding the scripts as indicated here, but it doesn't appear on any part of the filament admin app. For context, I am on a Laravel 11 app that uses Volt. But the file is still just a JS file sitting in that resources folder. https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files...
Solution:
Looks like using asset() is the proper way to do this to prevent copying the files. ``` class AdminPanelProvider extends PanelProvider {...

FileUpload (avatar) when record is in other model

I have made a Product model and a ProductAsset model. Using mutateFormDataBeforeCreate() and afterCreate(), I create a new ProductAsset with "is_primary" flag to tell the app that the uploaded image is the product's "avatar". Then I can create more assets using a RelationManager. So far so good. This is my form: ``` return $form...
No description

Reactive Forms Testing CI

I have a test for a form component that is working well locally, but I cannot get it to pass in GitHub Actions. I've tried so many different iterations without any luck. Here is the error that is returned in GitHub Actions: ```...