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 rule based on another field - Good way or not ?

I'm implementing a custom rule that verify that two dates are in the same year. Custom Laravel Rule ```php...

Upgrade v3 - Livewire and Alpine not loading

I just upgraded to v3. The admin panel seems to load but the screen is blank. If I inspect, everything seems to be there. One of the wrapping divs for the entire page is set to opacity-0 with the x-bind:style set to give it opacity. This is what gave me the clue that Livewire and Alpine are not being loaded. Also, my Livewire and Alpine dev tools both say that nothing is detected. Any ideas on why Livewire and Alpine wouldn't be loading for my admin panel? I also tried creating a second admin panel (/admin2) and it does the same thing....
No description

Multi-Tenancy with 2 different databases

Hi! I am Rohan, I am trying to apply multi-tenancy with multiple DB. I have two databases one central_db and second education db. I have to show the resources for the tables present in the central_db, my main database is education DB. Now tenancy team will be schools table in central_db. Now users table is in education DB and I have set a resource on User Model. But when I am trying to render the user resource, Laravel says education.schools table is not there I have attached the file with the code. Can someone help me out in where am I going wrong or is this how it will be for this scenario. Thank you...

Modal with dynamic actions

I want to create a Model using a livewire or blade-view that will show a few divs. When the user clicks one of the divs, an action on the main form has to be triggered with the name of the chosen picture as an argument. What I got working is that I'm able to launch a custom Action of my Livewire modal form, but that seems to do nothing, probably because it's in the wrong place. I think the action has to be defined in my main resource somehow. But then I won't be able to access this action in the modal. Or do I, somehow?...
Solution:
Ah, so you want to run something after the modal. That's not gonna work that way. You can dispatch Livewire events though and listen to those on your component. Inside your model Livewire component you probably don't even need a Filament action. Just some wire:click="$dispatch('your-event', 'data') and then you can listen for that on the page and run a method with: ```php #[On('your-event')] public function doSomething($data) {}...

How to make toggle button in infolist?

How to make toggle button in infolist?

Using Custom Layout blade for each panel provider

I want to be able to use a custom app.blade.php layout for different panel types. Customers get a more website-styled one and admin panels get a more admin-style panel. I would expect to be able to do something like return $panel->layout('layouts.customer') in the panel provider. Is there a way of doing this?...
Solution:
you mean this? ```php $panel ->topNavigation()...

Loading indicator on a custom action with alpineClickHandler

My action process is ran with alpinejs component rather than a submit action ```php public function securityKeyAction(): Action { $name = \App\Services\TwoFactorService::SECURITY_KEY_METHOD;...

ViewField Form error.

I have a form with a ViewField in it. ``` ViewField::make('users') ->columnSpan('full') ->label(label: 'Company Users')...
Solution:
Oh goodness me. My sincere apologies @Leandro Ferreira. I've changed the ViewField to be just a View and it's all working now. ...

Problems with SoftDeletes in Infolist with actions

Loading Entries with soft deleted relation works initially just fine but looses his state after clicking on an action. I dont know exactly what happens after i click on an action but it feels like its reloading the record without using the "getEloquentQuery" method and using my logic in there. After clicking on the action all the information of that relation are gone. The logic of the action doesnt get triggered just the opening of the modal is enought to loose all of my state....
No description

Can I change the language of a package without a language file?

https://filamentphp.com/plugins/firefly-blog I am using this package but I can't find the language files, how can I translate it into my language?...
No description

Hi, i need help handling a self referencing table via Select

hi, i'm trying to create a select for a self referencing table, but i seem to have run on some issues, is there a preferred way to do it? looking around most samples i saw did not work if table was empty, or the foreign key had a default value for level 0 of the tree, i wrote it like this: Components\Select::make('parent_id')->relationship('Parent', titleAttribute: 'name' )->default(0), but the selct field says it's invalid
Solution:
Yea so make it nullable.

Add Action Button on Topbar

I tried to add cart button next to the notification icon on topbar. But it didn't work. No modal opens when I clicked it. Here is the code in AppPanelProvider.php ```->renderHook( PanelsRenderHook::GLOBAL_SEARCH_AFTER,...

fresh filament install ui get trouble

anyone know issue about fresh filament install with the problem that the UI doesn't respond well, like something is wrong, I've tried to fix it but it's still the same

How to add description into ImageColumn?

In the table I'm building, I want to show the image, and also a description. How to achieve it?
Solution:
i created a custom field

Showing a modal with list of order products

Hello, I'm trying to show the list of the order products inside a modal using table, I've created a livewire component where I pass my order it and from there in my livewire component table i set a query to bring me a table with order products,...

Hi everyone, I'm having an issue with FilamentPHP's RichEditor component inside a Wizard form.

In my form, I have a RichEditor component inside different tabs (steps) of the wizard. The editor works fine in the first tab, but when I switch to the second or third tab, the RichEditor doesn't seem to load or function properly. Here's a simplified version of my form structure: public static function form(Form $form): Form { return $form->schema([ Forms\Components\Wizard::make()...

How to add blade directive to filament head

I'm currently installing https://github.com/silviolleite/laravel-pwa into my filament app, and I'm at the step where I need to include the blade directive @laravelPWA into the <head> of my page. Here is where I need the directive to go: ```php...
Solution:
You can do this with a renderHook

reload \ refresh relation manager table on page action

Is there not an easy way to refresh the a table displayed by a relation manager, when an action on the resource view page completes ?
Solution:

Help with Builder - no JSON

I am trying to use the Builder without JSON data. I want to use my existing eloquent relationships for the underlying builder. Is this possible? I tried to create a method on my model to return JSON that is a representation of the underlying database data but it doesn't seem to be recognizing that method. I think it is only pulling from the database a column name that matches the Builder::make("insert field here"). Is what I am after possible? Or am I going to have to change the database architecture of my app?...