Filament

F

Filament

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

Join

Lazy load and livewire refresh with tables

ok, so i have some alpine tabs and within those tabs are lazy loaded lw3 components with filament tables in it. Now on the parent component, sometimes i perform an action that would require one of those lazy loaded components to be refreshed (which really only matters if that tab is active). The problem is that if i sent the refresh event to a component that isnt currently rendered, it throws an error about $table must not be accessed before initialization. Is there not a native way to not att...

How can i catch Filament Import Action errors

I'm using Filament Import Action https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import There is a table called failed_import_rows and it has row data and field validation_error. But there are no validation errors so i have no glue why are some rows not imported. How can i catch/save errors occuring in row import?...

How to reuse a Form Field?

In using a DRY principle, I want to use Phone input that can be use in all forms. Currently, I've been copy-pasting them accross pages. ``` TextInput::make('phone') ->disableLabel()...

Custom Column Records

Hi fellas, i have in my database column data (text) which is casted to array. Now i want to have in table multiple columns with that data but on it's keys. I have issue that filament is not recognizing custom column when i say TextColumn::make('sync_type') which is part of data array.... It wont even register formatStateUsing(). Any solution?

How to add card details and generate stripe token using Relation manager form?

Hello, I am using stripe-php to add card information to Stripe and using card details relation manager for customers. I am able to add the card details in the self hosted form but Stripe requires us to generate token by sending card details using their Javascript api which I can send by dispatching the Livewire event but I am not able to set the value for the token field with the class card_token on the form after getting response from Stripe. Please let me know how can I generate the token, validate it and set the token as value for card_token textinput before submitting the form....

Refresh Table after performed action in Widget

How do I refresh the List page of a resource after I performed an action in a Widget on the List page
Solution:
add in your ListPage ```php use Livewire\Attributes\On; ...

canAccess() is called on every page/resource AFTER logout resulting in an exception?

I use a default panel for Filament but I have problems on using the default logout - either frm the user dropdown in the top navigation bar or using the account widget logout button. After clicking logout Filament redirects and calls the /logout route using a POST request. During that I get an error 500 and the following exception (see logs attached). This is the method that produces the error from my FeatureSettingsPage: ```...

Overwrite views from package

To overwrite Filament panel views (not recommended) we can copy files to resources/views/vendor/filament-panels/* and that works beautifully. However, I would like to overwrite the files from within a package. Is this possible? And if so, how?

How to get file size after file upload?

I am new to filament. I have requirement where after the file upload is complete. The 'Size' field in the form should have the value. Can someone explain how do I achieve this in Filament or what approach to use?...
Solution:
You'd have to use ->afterStateUpdated() on the file field then get the data and set it
No description

Redirect after custom action

Hi, I have a PostResource with a table, where users can top their posts, which creates a payment. I would like to redirect the user to the PaymentResource with a specific ID of Payment in infolist, which I want to show in modal. How can I do it, please? So far I have this code: PostResource in table:...

How to edit SlideOver

Hi can you help i want to swap the buttons in the slideOver like i would do if i have the form(show down) is this possible. I also want to edit the heading the when i click the edit.

protected function getFormActions(): array
{
return array_reverse(parent::getFormActions());
}

protected function getFormActions(): array
{
return array_reverse(parent::getFormActions());
}
...
Solution:
Find the problem for the heading this is the solution

Excel Export from array

Using exporter to export data to Excel table and it works just fine. But I've a properties column (array) structured like that: ```...

Spatie/translatable cannot mutate prop $activeLocale in relation manager

I followed the docs, on how to make a relation manager inherit the current resource's locale. But now when the RM loads it throws an error. I added the following to my relation manager: ``` use Translatable;...
No description

Avatar On Top Bar Not Appear

Hi. i have an issue with avatar on top bar not appear . My file storage ,app url already being set properly . In UserResource . the image appeared at the table as you guys can see in the pics . is there anything that i missing to setup ?
Solution:
If the image should be publicly accessible you need to use ->disk('public') and Storage::disk('public')->url($this->avatar)
No description

How to edit default color of the buttons

Hi i have a question how i can edit the buttons globally so i do not have to go every resource to edit color of the buttons

Refresh relation manager from action

Hi guys, I have header action on Infolist and I want to refresh relation manager of the resource after submiting action. Can you help me how to do that?

Form select not updating options data

so i was creating color from inside a Select components using createOptionForm(), I am expecting the data to return with the new created color, but its not returning it. code ```php ...

Go to page X by default on table resource page

I have a table with custom pagination where each page is divided by the number of week of this year. Let's say today is week 50, I want to go to page 50 directly whenever I open the resource table. Is it possible? Thanks in advance...

Cannot View or Access UserResource and Custom Resource in Filament Admin Panel

What I am trying to do: I am trying to view and manage the UserResource and another custom resource in the Filament admin panel. What I did: ...