Filament

F

Filament

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

Join

Modal Action with Wizard, add additional Footer Actions

I am using a the ->steps() method on an Action, to create a Wizard with a modal action: ```php use Filament\Forms; use Filament\Tables\Actions\Action; ...

Should we duplicate code to make wizard edit steps ?

I made a big steps form to create my resource but for the edit should I duplicate this code ? (I hope no) Thank you...

Defer the table row actions rendering?

Hi there! I built a Resource table with ~ 200 rows. Displaying this page takes about 7000ms. I first thought about an N+1 issue but not!...
No description

Middleware auth + custom in Filament Blade

can i ask something differnt? i have some page /building/id /my/transaction /my/booking ...

i want to change routes login in filament

by default the login page locate in /admin/login, i think this doesnt make sanse for role user to login, so i decide to replace the login routes from /admin/login to /admin, but it doesnt work for me, can u help me? in admin panel i already add ``` return $panel...
No description

Action form, validate data from API

Hello everyone. I use Action as forms, and I would like to check some condition via an API call first before the form submits and reset form. Essentially the form will try to submit, I make an API call to see if the form data is viable and throw a validation error if it isn't based on the API response. Normally, I would let the request submit and then fail if it doesn't pass the validation. But this is a very big form, and having to redo the whole thing might not be great for the user....

Testing ListResources page with tenancy (missing parameter: tenant)

What am I missing here? 🤔 ``` test('lists groups', function () { livewire(GroupResource\Pages\ListGroups::class, [ 'tenant' => $this->client->uuid,...
Solution:
Tenant is set separately not as a parameter to livewire
Filament::setTenant($this->client);
Filament::setTenant($this->client);
...

Add a button to a column

Hi. I need to add a button to a specific column in a table. Can you please tell me how I can do this, are there any ready-made solutions or do I need to write the view myself?
Solution:
To a specific column you can add ->action() to the column which will be the button action, say on a toggle or an icon column.

[Tab]-Key and [Arrow]-Keys in combination with Selectbox causes strange things

I've got a form arrangement with a textfield and a Select field with searchable. If my focused field is the select field and I press [Tab] then the focus will be on the selectbox. If I do now press [Arrow-Down] then the searchfield of the Select contains the text "arrowdown".
Solution:
Hi, it's a problem linked to a dependency: ChoiceJS. The problem has been fixed on their side, and will be available for V4.Find out more here: https://github.com/filamentphp/filament/issues/5707 🙂

How Create this section with Filament php

Hello everyone, I hope you're all well. I'm working on a custom design with a PHP filament, and I'd like to know what other people think. Is it possible to develop this kind of design with a PHP filament? If so, could I get some help?...
No description

Filament\Forms\Components\Select::isOptionDisabled(): Argument #2 ($label) must be of type string,

I get this error on a select filter with relationship Filament\Forms\Components\Select::isOptionDisabled(): Argument #2 ($label) must be of type string, App\Enums\ProductType given,...

How to create a cluster without sub navigation UI in the resource page?

Hi, I'm trying to create a cluster for blogs where the first resource is articles. This makes the url domain.com/admin/blogs/articles like I want. However, the articles resource in the blogs cluster is half the navigation and half to create a new article. I know i can create an articles resource and then set a navigation group. However, I want the url to be blogs/articles so it's logically grouped. In addition to the organization of things inside the cluster folder structure. ...

How can I use Filament Spatie Translatable with SEO Filament ?

Hi, I’m trying to implement Spatie Translatable with an SEO relationship, but when I change the locale, the SEO fields do not update. I created a new SEO model that implements the HasTranslations trait and defines a translatable array. I also set up my resource pages, but… nothing =/...

Modify query when loading edit/view form

What is the best way to modify the query when loading an edit or view page? Using soft deletes. So when I select a user in the table, I need to modify the query so that a soft deleted user can be loaded for editing/viewing. Otherwise, nothing is returned. This results in a 404 - Not Found when loading edit / view resource....
Solution:
@awcodes Believe I got it figured out. ```php public static function getEloquentQuery(): Builder
{
if (Auth::user()->hasRole(Roles::SUPER_ADMIN)) { ...

Way to only allow numeric in search dropdown for filament select element?

Hello! I have this select for Zipcode that populates after the user types inside the searchable() search options dropdown. To enhance my accessibility for a screen reader, I want to disable non-numbers, so that we don't run into as many issues. Is there a way to do this? I'd love any tips on how to modify/validate the search field on a select. ...
No description

Optionally activate table summary with action

I have a table with multiple columns, one of which has a summary. Since the calculation of the values takes 3-4 seconds, I would like to display the summaries only optionally. For example, only after clicking on a page or table (header) action. The only way I see to achieve this is via the hidden method of the summary (->summarize(Sum::make()->hidden(true))). So I tried it out (even without the Action Button), just to see how it would work: However, this only hides the summary values, but the request still takes 3-4 seconds, and the summary rows are still displayed at the bottom (empty). Any ideas or something I'm overlooking?...
No description

Override table view to list a subset or scoped set of records

I have one resources that has many thousands of records for logs that I want to make aviable via multiple resource objects tailored for each type. How do I override the query on the list or table view to load that resource with a specific subset? On the model, I've added a scope for each type ```...

Select createOptionUsing shows the record's ID and not the text

hello, i have a Select with create option, here's the code ```php public function selectCustomerForm($form): Form { return $form->schema([...

Modal pops up for Action button that's not defined as modal, when closing an actual modal.

I have two buttons for downloading pdf templates, one is defined as modal in resource and opens modal for further selection of pdf templates and other button just goes straight to downloading all PDFs. However, there's a weird bug - if I download all PDFs and then click on another button and close it, it will open modal for the button that simply downloads all templates (even though this is not defined as modal). I have no idea why this is triggered or how.
No description

SoftDeletes

I'm using SoftDeletes on my model, and I'm using tabs (all, active, archived) on the resource list, on my db I have 33 entries ( 2 with deleted_at not null). The issue that I don't understand is why when I click on the 'all' tab I got only 31 entries (the deleted ones are excluded) and when I click on 'archived' tab I didn't get any entry (even there are 2 entries on my db). Do anyone has an idea about this issue?...
Solution:
The problem was there, because of the trashedFilter, it's applied automatically and it excludes the the trashed records by default. When I get ride of it, things work perfectly as expected.