Filament

F

Filament

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

Join

Missing rollbackTransaction argument in halt method in packages/panels/src/Pages/BasePage.php

This BasePage Class was extended in all Resources Page Classes like CreateUser,EditUser,... I modified protected ?bool $hasDatabaseTransactions = true; in the resources page class and for my situation i modified handleRecordCreation method in Create Resource page class i need to use $this->halt() but it doesn't have the argument to rollback db transaction. so i manually using this throw (new Halt)->rollBackDatabaseTransaction();...
No description

Change the 'Create' label in the resource create page

I just want to change the color and the text inside
Solution:
Here's how ```php protected function getCreateFormAction(): Action {...

SQL Syntax Alias Error When Using Table Summarizer

My case is because I have multiple database connection on my application. So in every model I need to use: ``` public function getTable(): string { return "{$this->getConnection()->getDatabaseName()}.mytable";...

Select row on table row click

I want to select when a Table row is clicked. So that its function is like select for bulk action. ```php ->recordAction(fn () => WhatTriggerToSelectTheRow)...

Update request took so long (only for updating another field)

Is this normal behaviour that update requests took so long (up to 10s) only for updating / showing another field with no queries going on. I am using Core i3 10th gen with 8 GB ram and using Laravel octane to run the server. I've already cached the icons, run all optimization commands available and caching, disabling debugbar, but still taking too much for a simple update. is there any way to debug the bottleneck or optimize it?
No description

ExportAction on Row to export another model with HasMany relationship

Hi there, I am trying too add an export action to the end of my row and has it export the related model. I have a resource that shows all my Posts and at the end of each row i want to have an option to export the comments from that post. The post has a HasMany relationship to the comments. I have a resource for Comments but it shows all the comments for all the posts because from a moderation perspective makes less sense to have to click into everyone post through a relationship manager to approve comments. I was able to export all the Comments through that Resource without any issue. Just want to add it to the Post Resource to to grab only for each post. ...

how to put filament table inside filament form

Is it possible to put reactive filament table inside the filament form edit/create resource ?

Add shared data to Infolist Livewire fields

I am using custom LiveWire components in my Infolist which look like so: ```php InfolistSection::make('RVO') ->schema([...
Solution:
public static function infolist(Infolist $infolist): Infolist
{
$record = $infolist->getRecord();
public static function infolist(Infolist $infolist): Infolist
{
$record = $infolist->getRecord();
...

Form data save issue.

I am having an issue with relationships. I think. This issue i am facing is that when I create a new object in a repeater. The initial save is not saving the relationship to the users address but if i go back and update it, it then saves and updates the address. I am trying to diagnose the issue since the form updates after the user detail object exists.

No way to Mutate form data for created record using an action button on external resource

As the title suggests, I am attempting to create a record inside of another resource using a modal while passing values from the current record. The general use case is that I have a record open and would like to create a 'task' based on the current record. As such, I have a create action button, which triggers a form from an existing resource. The issue arises when I try to pass current form data into the modal. I found that mutateFormDataUsing, using, etc. seem to run after it's submitted, which is unhelpful. I did find afterFormFilled, which can be used to modify the table after default fields are entered, but there's not really any documentation on how to use it beyond simply stating that it can be used and my best efforts seem inconclusive. I have also messed around with $form->fill([]) (see below) as part of the form function, but may be doing it wrong as while the form still shows up, it does not pre-fill the values....
Solution:
What about the ->fillForm() method on the Action itself?

Table Column Relationship Sum, Avg, Max, Min, ext being ignored

I have model that consists of products. The products have a relationship of locationInventory that contain the inventory numbers for each location. On my Product Resource Table, I have a column like this: ``` Tables\Columns\TextColumn::make('locationInventory.quantity_in_stock') ->label('In Stock')...
Solution:
changing it to quantity_in_stock_sum made the column blank. But changing it to quantity_in_stock has it properly summing the values. Thanks for your help!

builder bug

i have a builder set up and its working perfectly, however there is a "insert" button that shouldnt exist between my items and it actually works (again, it shouldnt). Can anyone help please?
No description

How to apply <novalidate> to Action Modals

Sometimes I prefer to use the backend validations rather than the browser validations. Any idea idea how to insert novalidate to the <form> from Action modals?

Add filepond captureMethod for FileUpload via Camera

Feature Description I propose the addition of a new option captureMethod to the FileUpload component within FilePond. This feature would allow developers to specify how the file input should capture the data, particularly useful for mobile devices where the user can choose to take a picture or video directly or select existing files. The primary aim is to enhance user experience and provide flexibility for developers to tailor file input behavior according to the application's needs. Forms\Components\FileUpload::make('image')->image()->captureMethod(['camera'])->required(),...

Custom "Save" button to create or save a form

I'm trying to add a custom "Save" button (i.e. action) to a form. ``` ... use Filament\Forms\Components\Actions\Action; ......
Solution:
You could create a trait with a custom method and use this in Create/Edit page.. ```php public function createOrSave(): void {...

Custom theme - Tailwind class not included in built css

Made custom theme and required steps but my added Tailwind class is not in CSS. For testing i added Tailwind class text-ellipsis to app/Filament/Resources/ProductResource.php ```php Placeholder::make('documentation')...

Modify create button to do more than create

Am I doing this right? I want to create the record, but also go to the checkout page. ```php...

Infolists headerActions not working.

I can't figure why the headerActions function on $infolists doesnt show any action that i put inside of it. Instead the footerActions seems to be working prerfectly. so i'm on "filament/filament": "3.2.85", "filament/infolists": "^3.2",...
Solution:
Hm, weird. Tested it with the same version and it works. Can you try php artisan filament:upgrade?
No description