Filament

F

Filament

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

Join

badge in global search

Any chance I can use badge in Global Search? ```php public static function getGlobalSearchResultDetails(Model $record): array {...

New tailwindcss classes not bundling in new blade files

Wondering what I'm doing wrong. I have composer dev / npm run dev running, and created a new file: resources/views/livewire/application-nav.blade.php...
Solution:
to include new classes you need to build a custom theme first

Filament 3.x: How to open a modal from blade template

Hey together I have a modal within a livewire component which is build with Action::make('something')->form(...). At the moment it renders a trigger button which opens the modal. In a special case i need to open this modal dynamically on page load. How can I achieve this?
Solution:
<div wire:init="init">
@if ($isAdmin)
...
<div wire:init="init">
@if ($isAdmin)
...
...

Odd issue with form select on virtual column

So I have a virtual column in my orders model defined as below: protected function TitleAndID(): Attribute { return Attribute::make(...

Select and media upload not loading and working correctly

I’ve built an admin panel using Filament, Filament Forms, and Spatie Media Library Upload. However, I’m encountering issues in production where two of my components are not loading correctly, and I’m seeing multiple AlpineJS errors. Strangely, everything works perfectly in my local environment. Issue: When using Filament Forms and Spatie Media Library together in production, two of my components fail to load correctly, and I see numerous AlpineJS errors in the console. ...
Solution:
@Leandro Ferreira The problem has been solved now. I did not have the correct filament javascript files in my root folder.
No description

Any way to create collapsible/expandable table rows while having normal table headers?

Is there any way to achieve this? By making collapsible views and using split the headers are removed as its not really a table anymore, so I guess thats not an option

ModalContent inputs pass to action()

BulkAction use modalContent custom view blade with inputs - how to pass input values to action after confirm modalDialog?
Solution:
add public $notes = []; to your ListPage inject $livewire in the action: ```php...

Filament vite manifest not found!

How can I fix manifest.json not found on Laravel Cloud? I know npm run build will work correctly. But on Laravel Cloud, the first command is composer install --no-dev that command run all the things before npm install. That's why I got the error. So here is how I fixed? - I removed php artisan package:discover --ansi . But I run after npm install. Is that best approach or not? How you guys handle this case? error ```md...
Solution:
It's because of the package:discover command. You might need to remove it and run it manually after npm run build

Multiple Relationships

Hi guys, is this relationship possible? I'm in my ProjectTask model, and want add sub tasks which are a few relationships down (via tasks) Forms\Components\Repeater::make('tasks.subtasks') ->relationship('task.subtasks') ->schema([...

How can I format price without focus?

``` Forms\Components\Select::make('product_id') ->label('Product') ->options(Product::query()->pluck('name', 'id')) ->required()...

TailwindCSS

I have a resource that uses a custom Blade file, and I need to display a Google Map below the name input field. Unfortunately, the form or page appears disorganized, as shown in the attached image. However, when I add <script src="https://cdn.tailwindcss.com"></script>, the page looks much better.
Solution:
Got it, just need to add this
->viteThem('path/to/css')
->viteThem('path/to/css')
to my panel provider
No description

Unable to use before() & after() in Wizard form by using submitAction()

```php public function form(Form $form): Form { return $form ->schema([...

ToggleButton state return string

Inside the protected function: ```php handleRecordUpdate(Model $record, array $data): Model { dd($data);...

Select Option Disabled Based on Another Field's Value

Code: ``` Select::make('status') ->options([...
Solution:
You’re not resetting the name field. So the name in the data is still bob. So you need to $set(‘name’, null) in the status afterStateUpdated() too.

Summarising groups of rows - distinguish group and overall summaries

What I am trying to do: I have grouping data in a table by description. Each group shows a correct summary applying the limit check (min($totalPoints , $maxPoints)) But the overall total at the bottom incorrectly applies this same limit to the sum of all groups, rather than simply adding up the already limited group totals. How to distinguish between group and overall summaries?...

Upgrading to Filament >= 3.2.138 causes black screen/modal overlay bug.

Researching a bit, it appears to be tied to https://github.com/filamentphp/filament/pull/15559 but I am surprised no one else is having the same issue? After updating the version I am running php artisan filament:upgrade and also php artisan filament:optimize , have also tried clearing browser cache and I still get this behavior. For me it's on all versions >= 3.2.138. Downgrading to 3.2.137 instantly fixes it. The bug itself seems to match up with what is described here; https://github.com/filamentphp/filament/issues/15017 the tables load fine, but any action on the table e.g. changing the rows or using a filter seems to cause the black modal overlay to appear. I have no console errors. Any ideas? The github links imply that this issue is resolved so I am wondering if I am missing something here. Thanks in advance...

Filament Form: Dynamic additional_fields values not being saved properly

Hi everyone, I'm having an issue with dynamic fields in Filament where values entered in the form are not being captured properly during the save process. My setup:...

Persist tab in InfoList when using getTabs function

How do I persist Tabs when using the getTabs() function in the List Resource? I see how in the docs when building up a Tab using ->persistTabInQueryString('settings-tab'). ``` public function getTabs(): array {...

Testing relation manager actions

I am trying to test the actions of relation managers to get 100% code coverage across an internal project we have. However, the furthest I can get are exception that the create actions is not being rendered/present on the livewire component. I am seeing the create action while logged into the panel. This is a trimmed down WIP of an example test I have with some specific business logic from the app trimmed out....