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 test an Import Action and its Importer class?

I don't see any tips or good practices in the documentation on how to properly test this, do you guys have any suggestions on how I can tackle this?

Looking for a way to search table based on custom state

Hello all I have the following Textcolumn: ``` TextColumn::make('object') ->label('Object') ->translateLabel()...

Mount action after another action

Hi, Is it possible to open a new action form when pressing "Send" on the first one? After I sign a document via a modal, a popup should display to send an email. ...

Text Input Column Validation Not Working

Hi, I am trying to add a rule (validation check ) to the date text input column rendered in table builder but for some reason it is not working also is there any way i can access the record in the function because unable to do that as well; it gives the input state ...

Is there any way to get tenant information on login page?

Hello, I want to get tenant (team) information on login / registration page. i am currently using filament's multi tenancy for single team per user and invitations. ...

Unique validation on edit throws error

I have a form field which have unique validation. When I am trying to update the record it throws the unique validation error. The documentation mentioned to add the ->unique(ignoreRecord: true) but didn't helped. Anyone face this issue before? I also tried this ->unique(ignorable: fn ($record) => $record) but same result.
Solution:
I found what was the problem. So the $record somehow was null and that's why validated the unique every time. The workaround for this I passed the record from the Livewire component:
use Livewire\Component as Livewire;
->unique(ignorable: fn (Livewire $livewire) => $livewire->record)
use Livewire\Component as Livewire;
->unique(ignorable: fn (Livewire $livewire) => $livewire->record)
...

When Changing url should not work in filament any method

I am using multiple logins and provider ,using middleware , i called in my every pages and resources those middleware's what i need http://exam.test/student when changing student to admin after /its should not work any possibilities we are having filament ..can you give guide anyone solutions

Tenancy - 3 levels: Super Admin, company, client

I need your kind assistance to direct me to the best solution for below. I currently have 2 panels: 'admin' and 'company'. The result I want to achieve is:...

Repeater Get Value from outside schema

Hi, how to get client_id_repeater, from outside to afterStateHydrated repeater, thanks `TextInput::make('client_id_repeater')->live(), Repeater::make('responses') ->schema([ ...

How to set default date in DatePicker form field in filtersForm?

I have a custom dashboard class, where I want to add a filtersForm, with a date field that should default to todays date (now()), but the default is never being set in my form when I try to do this: ```php <?php namespace App\Filament\Pages;...

ask

hello @evryone i've been start my projects for my user without filament, and now i try using filament to admin role, how should i configure it

Disable Reorder Table on View

Hi, I use relation manager and enable reoder, everything works normally. But I want reoder only active on edit page, how to implement it?  I used visible/hidden but both are inactive (view and edit page)....
Solution:
something like this?
->reorderable(fn () => str($this->getPageClass())->contains('EditPost') ? 'sort' : null)
->reorderable(fn () => str($this->getPageClass())->contains('EditPost') ? 'sort' : null)
...

Issues with Email Verification Redirect in Filament/Laravel Setup

Hi everyone, I'm facing an issue in my Filament + Laravel project related to email verification. After verifying an email, the user is redirected to the login page instead of the intended success page. I've tried several approaches, including Laravel's default verification, a custom VerificationController, and Filament's built-in methods, but nothing has worked. Key Details:...

My Tenants Resource doesn't show in Menu

Hello, I use stancl/tenancy package with filament. Everything is working (tenants with multiple db) but i cant see my tenant resource in menu. I had use filament sheild plugin but I uninstalled today. I cant still see my tenant resource. I search on web a lot but I dont found anything. When trying to access resource page, I got 403 error. I checked file permissions.
I tried clear configuration and route caches, re-migrate, create a new resource "composer dump-autoload" command but didn't help 😦 . ```php...
Solution:
I solved, delete old policy files.

Exclude rows from reordering completely

I'm working on a Laravel application where I have a many-to-many relationship between Campaign and Question models through a campaign_question pivot table. Each question associated with a campaign has an order (a number) that determines its position. However, I have two types of questions: Main Questions: These should be assigned an order and appear in a specific sequence....

Conditional Eager loading issue

I am trying to eager load for table function in my MemberResource.php but I dont see table list after this. Since I have polymorphic realtionship, so i need to eager load conditionally and that is not working. Where i am going wrong. when I comment out conditional part of eager loading, I see table list. ``` public static function table(Table $table): Table { return $table ->modifyQueryUsing(function ($query){...

If I want to extend a form component to my own class, where do I do this?

I guess what I'm asking is where in the app structure would you do this?
Solution:
maybe app/Forms/Components ? same path when you create custom components....

How to see the file uploaded using ->url()?

I already linked my storage, so it was on public/storage and I know laravel have a safety about accessing the url of public/storage. I would like to know how can I access the file via url as logged in user?
Solution:
TextColumn::make('document')
->url(fn (YourModel $record): ?string => Storage::url($record->document))
->openUrlInNewTab()
TextColumn::make('document')
->url(fn (YourModel $record): ?string => Storage::url($record->document))
->openUrlInNewTab()
...

Troubleshooting CSV Import

I am trying to use the new CSV import function in Filament 3.1 but I only get the very unhelpful error message: local.ERROR: Multiple types of exceptions occurred: [ErrorException], [Illuminate\Database\QueryException] {"userId":1,"exception":"[object] (Exception(code: 0): Multiple types of exceptions occurred: [ErrorException], [Illuminate\\Database\\QueryException] at /var/www/html/vendor/filament/actions/src/Imports/Jobs/ImportCsv.php:174) What can I do to get more fidelity on what errors are actually occurring or what I'm doing wrong with the Import action?...