Filament

F

Filament

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

Join

Filament Multi-Select Not Loading Default Values from Third Table (Not Pivot Table)

Hi all, I'm facing an issue with Filament in Laravel where a multi-select field isn't loading its default values in the edit form. My setup involves saving selected values in a third table, which isn't a traditional pivot table but rather an additional table (CarUsageRecord) related to a Task model. The Problem ...

Custom Layout in Filament V3

Is it possible in Admin Panel Filament V3 to create a layout like this: on the left side, there is a list of data 1 displayed as cards vertically, in the center, there is a map display, and on the right side, there is a list of data 2 also displayed as cards like data 1? If possible, could you provide references or documentation that I can check to create such a layout?ad
No description

Set user_id on new record

Hi. Where do I set the user_id of the record? mutateFormDataUsing is not bee called! Why??
Solution:
It goes in the CreateRecord file
No description

pest 403 for List page

Hello I try to write a pest test to test the table. ```php beforeEach(fn() => asAdmin());...

Is it possible to insert or create a copy of data automatically from current table to other table?

Is is possible, when I create a data in tb1 it will create also a copy in tb2? I'm trying an automation here, I'm trying to insert the data from current form to othe table upon submission....
Solution:
observers or afterCreate hook in your CreatePage ```php protected function afterCreate(): void {...

MorphToSelect is too slow

MorphToSelect for reading from large database is too slow. Is there any better alternative or any approach i can apply for chunking here. I have Member model which has MorphOne relationship with Company and User models. I need to select member in lets say LeadResource. Below is the code:- ``` Group::make() ->relationship('member')...

summarize calculated fields in footer

How can I add a custom calculation to the footer of a grouped table? These three columns show up great for each row and the footer group summarize works for the first two. Just cannot figure out the summarize for the third calculated column... Trying a custom summarizer: ...

Add view to table page

Hi how can i add a custom view to the top of the table page? I want to add a view below the title Public profile, but can't seem to find any info, thanks
No description

Statamic or Filament as CMS, and maybe more, for my App

Hey. I'm thinking of using Statamic or Filament with an app I'm building to supplement it by acting as a CMS for things like creating and updating plans/tiers, and other content the app could use. I don't want to have to manage this information on the backend and would like to involve other team members in the management of this kind of data. Recommendations?...

How to get file in action form

Hi, i have this modal form on list page and i need to get file in submit method, but i do not know how, is it possible? under data is just string with file name that not exists. ```class ListPayments extends ListRecords { protected static string $resource = PaymentResource::class;...

How to make the action column first in the table?

How to make the action column first in the table?

How can I add alpine plugin to my filament plugin?

I have the following js file: ```js import sort from '@alpinejs/sort' document.addEventListener('alpine:init', () => { window.Alpine.plugin(sort)...

Customize filament blade

Hi guys, how can i re customize some html of the filament dashboard

Accessing Model /ResourceIn Widget

I know this has been asked a lot, and I have done a lot of searching trying to figure this out but for some reason I cannot access the Model when I am on a View Page. I have tried:
use Illuminate\Database\Eloquent\Model;

public ?Model $record = null;
use Illuminate\Database\Eloquent\Model;

public ?Model $record = null;
to no avail. It always responds with an error saying 'Attempt to read property "name" on null'. If I remove the = null portion I get an error saying I can't access the variable before it is initialized. I have created a very basic widget using the CLI and run into the same issues even when starting from scratch....

Coloring each element

I want colorize my column texts and other stuffs in custom, like price column should be visible beside other columns so I should make it green text and things like that...

Full name calculation with afterStateUpdated

Hi. I use many inputs to calculate a name. 1. How can I abstract the function called in each afterStateUpdated to one function outside (sorry for this simple question) 2. Why I can't write the "Nombre" field? afterStateUpdated regenerates "fullname" Thanks...
Solution:
My suggestion until v4 would be to use ->live(onBlur: true)

Sorting Repeatable Entries on Infolists

Am I correct in that the best way to preserve the sort from a Form Repeater field to an Infolist Repeatable entry is to modify the relationship with ->orderBy('sort');? I spent quite some time looking through the code, and assumed there would be some sort of default query modification happening, or a similar option to the orderColumn function available on the Repeater component. If this is the case, I'm happy to open a new PR to update the docs with this suggestion, but wanted to confirm....

odd form behavior on relationship

From reading through topics and the docs, I've gathered that in order to use a relationship on a form field, I need to use a form layout component and set the relationship. I have a form in a page component that I'm not populating until the user clicks a button. I'm able to populate the form with what I've got right now, but when it comes time to save, $this->form->getState() returns one field but not the one with the relationship. mount method:...

MorphToSelect only disable type field

Hello Is there an option to only disable the type field or the id field in MorphToSelect? I didn't find anything in the docs...

How to limit the decimal to $set in the other field by 2?

``` Forms\Components\TextInput::make('copy_interest') ->label('Interest') ->dehydrated() ->numeric()...