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 disabled select in form

i have this code Select::make('status') ->label('Status') ->required() ->options(collect(InvitationStatus::getValues())...
Solution:
Using ->dehydrated() at the end ensures the field is included in form submission even when disabled

Unable to put 2 Livewire Components inside a form

Hello, i am trying to make a form and put a table inside the form so that when the user selects an option the table will update to show the related data. I have 2 Livewire Components with filament table builder inside it. When i use the both table at the same time one table always disappears. But works fine if one table is commented out.
Solution:
I was dumb. I didn't define the key
No description

Form doesnt work with builder blocks and blockPreviews

Two issues: 1. If preview view has form element, create button doesn't work. Even tho the form is removed from html. (But create another button works) 2. If we add multiple blocks with forms, second forms are not even removed from html. (pic) ...
No description

When do you use multiple panels?

I have this project where both admin and user stuff are in the default AdminPanelProvider, the access control is done via checking the permissions/role of the User. However, for cases where assuming admin and users has different workflows, wouldn't it be much better if they have their own dedicated panels? In this case there will be: AdminPanel and UserPanel. Though personally I would rather have different panels, although maintaining them whenever there's a change/new feature can be quiet taxing....

How to avoid showing all widgets on all dashboard pages?

Hi, I want to create multiple dashboards, each with their own specific widgets. I have this kitchen dashboard for example: ```php ?php namespace App\Filament\Pages;...

Unable to create notifications

Trying to create notifications in the database, i followed the docs but when i use any of the recommended methods it doesn't throw a error nor does it create a notification, any idea why? Methods that i tried: $recipient = auth()->user(); Notification::make()...
Solution:
Found out why! i needed to use php artisan queue:work

reset password

Hello I have multi panel project. The code in UserPanelProvider have these return $panel ->default()...
Solution:
the solution was php artisan filament:optimize-clear after this worked
No description

->getSearchResultsUsing but on SelectFilter

What should I use to replace method ->getSearchResultsUsing, but on a SelectFilter?

Form inside Livewire Component:

In a livewire component I want to put a form, in this a select that must take the data from the Bank model. How do I enable new records to be created in the Bank model? public function form(Form $form): Form { return $form...

How to add an Action to the table next to the search?

I need to add an action to my form table but I don't know how
Solution:
in service provider or middleware add ```php FilamentView::registerRenderHook( PanelsRenderHook::BODY_START,...
No description

Action in custom page

Hello, Have a simple button in blade view ```<x-filament::button wire:click="challenge" class="primary-bg">...
Solution:
The action name should match the function name

It's possible change the <title> of the page without change the dashboard title

I need to change the title showed in the browser. But I have keep the title of the dashboard the same. Its possible?
Solution:
because, logic heading return $this->heading ?? $title();
No description

GetRelations another getrelations

is there possible to add another relationship manager below?
No description

url styling with custom theme

I've added a custom theme and applied it to a specific panel. Without me adding any actual customisation, the action buttons that contain a url action like: ``` Notification::make() ->title('Saved successfully') ->body(implode(' ', $notifications))...
Solution:
Just realised why this was my fault, and not something happening in filament, thanks for suggestion anyway!"
No description

Attaching additional information to a RelationManager?

When I add a RelationManager I want it to ask for or populate the year from a drop down - how can I add that in?
` Tables\Actions\AttachAction::make() ->preloadRecordSelect() ->recordTitle(fn (Model $record): string => "{$record->student_number} - {$record->first_name} {$record->last_name} {$record->grade_level} {$record->school->name}")...

How to display two different widgets in dashboard page side by side?

``` class JobsCountChart extends Widget { protected static ?int $sort = 1; // Rest of your widget code......
No description

Spurious errors on ViewAction/EditAction upon saving.

Hey everyone, I hope you're all well. I have several Filament forms which are embedded within Livewire components, not panels. This was done under instruction. There are over 50 Livewire pages which contain embedded Filament PHP tables, of the form -...

Unable to download export file

Hi. I am using Filament v3 and Stanc Multi-tenancy v4. If I use Filament export functionality, I keep having : No [App\Models\User] model found. Please bind an authenticatable model to the [Illuminate\Contracts\Auth\Authenticatable] interface in a service provider's [register()] method ...

Inject other field state into viewData on ViewField

Hi, I have a field that is ToggleButtons. I then have another field which is a ViewField which I would like to regenerate depending on the option that is selected in the ToggleButtons field. At the moment, the way that I do this is to use $getRecord() in the view and then look at the value in the toggle field. The problem is that it only updates when the record is saved (as you would expect)....
Solution:
use in the view
{{ $evaluate(fn ($get) => $get('your_toggle')) }}
{{ $evaluate(fn ($get) => $get('your_toggle')) }}
...

How to easily center a label

How can i easily center a label? Without centering it for the hole project, only for one Field in a Form Component? Is there a easy way to center a label? https://filamentphp.com/api/3.x/Filament/Forms/Components/Concerns/HasLabel.html...
Solution:
Finally i just removed the label (by using ->label('') ) and added a Placeholder right above the field, with ->content() and added the Titel there. With HtmlString I could position the Title like I wanted