Filament

F

Filament

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

Join

No data on textarea, input and select on modal when update or view

I have same issue with this https://github.com/filamentphp/filament/discussions/13488 The case is in my local it's ok but on prod there is no data and got error
Uncaught ReferenceError: state is not defined
Uncaught ReferenceError: state is not defined
...
Solution:
Ohh.... I solved it by just upgrading the filament version and composer install

Is anyone having livewire 3.5.13 issues? Black splash screen.

Suddenly, I'm getting black screens on ALL filament "ajax" interaction. Opening a modal, clicking a table sort, etc. I've tied it back to Livewire 3.5.13. Rolling to 3.5.12 works fine. I've reduced my plug-ins and nothing is working, other than rolling back Livewire....
Solution:
There is a bug in livewire 3.5.13. Filament has locked down to 3.5.12.

Page rendering issue

I'm trying to build a page that displays a CUPS printer queue but my page is presending a bit weird. The button that I would expect per queue is just one big button with multiple names all on one button, and then the items in a queue are just showing. The line breaks never appear. Thoughts? `<x-filament-panels::page> ...
Solution:
Aha - found it . . . using PHP_EOL to split lines now. That solved it. ` public static function printer_list() { $result = Process::run('lpstat -e');...

Overriding paginateTableQuery doesn't work on Widgets

The TableWidet Class has a paginateTableQuery method where simplePagination is used. The docs say, this can be overwritten. But using the method in my Widget doesn't work. It still shows the simplePagination. With dd() I can verify that the method gets called though. Any ideas? Code:...
Solution:
Yes I see, but in that case the paginateTableQuery is set to simple when extending the TableWidget. Changing it to extend "Widget" solves the issue. But I still don't know why the overwrite didn't work, as it normally should.

Issue with reordable table

```php public static function table(Table $table): Table { return $table ->columns([...
Solution:
You click the button and the table starts "reorder mode". You can then reorder entries via the arrows at the beginning

help with repeaters and updating data pls

Hello. I've got a Purchase Order resource with a repeater field on it. The repeater field is for items, and each item can have a name, quantity, and received quantity. When creating a purchase order, a user can add as many items as they like and set a quantity. The received quantity defaults to 0. The user can then upload invoices associated with the purchase order. In so doing, here's what I want to happen:...
Solution:
So you want ->disabled() but ->dehydrated(true) I believe

Order of Clusters in Navigation

Does anyone know of a way to sort Panel Builder Clusters in the navigation menu is a specific order? Similar to
protected static ?int $navigationSort = 1;
protected static ?int $navigationSort = 1;
in a Resource class....
Solution:
Would you believe it! This works: ``` <?php namespace App\Filament\Clusters;...

Any way to make checkbox readonly but not disabled ?

Checkbox::make('done')
->inlineLabel();
Checkbox::make('done')
->inlineLabel();
...
Solution:
I think you want it disabled but that makes it an ignored field, right? as a solution use ->dehydrated() as in the docs: Toggle::make('is_admin') ->disabled()...

Change the label of the 'All Model' summary in a filament table?

I am grouping the rows in a table by the date and have added a summary of Sum with Label 'Day Total'. In the bottom of the table there is a row with All Model and it also shows 'Day Total' but I want it to be 'Grand Total' What can I do?
No description

Getting filament to use my own getLabel() implementation

The Filament\Tables\Columns\Column uses the Concerns\HasLabel trait. Inside this trait, there is a method named getLabel() I would like to customize it a little bit. First, I duplicated the original HasLabel.php to put it under app/Filament/Tables/Columns/Concerns project folder and customize the getLabel() method to just return a test string:...

fillament-php multitenancy implementation

i want to understand if this implemenation possible with multi-tenant filament-php even with some changes - a user is created without team. - when a restaurant is created it automaticly gets a new team created for that particular restaurant....

Como trocar o titulo da relation ?

Tentei com get title porém da erro, setei o nome da model e n adianta, como consigo trocar? Desde ja agradeço....
Solution:
Try $table->heading('xx')
No description

Select make on attribute that is an array

Hello, I have an attribute that is returning an array of enumerator. the field is called roles. i am trying to create a Form with a Select::make('roles')->options(Role::all())->multiple(). the Role::all() is not a model it is an Enumerator with a static method all() that returns the cases of the Role enum. the roles attribute on the model is using casts to convert a csv value like this admin,student convert it to ['Role::Admin','Role::Student'] when i am accessing the $user->roles. I am not...

Import with relation.

Im doing something like this but is not working. how should I do this? ` ->relationship( resolveUsing: function (string $category) { $item = FoodItemCategory::firstOrCreate(...

How do I generate a random reference?

I've got a resource with a reference field that I want to automatically generate a random identifier for. The user opens the record creation page, and the default value is "INV-0001" or "INV-4829" (haven't decided if I want it to be random or incremented yet). How do I do that?...
Solution:
->default(fn() => 'INV-' . Str::random(4) )
->default(fn() => 'INV-' . Str::random(4) )
...

Reactive Fields

I've got two fields, purchase order and vendor. A purchase order object also has a vendor attached to it. I want it so that if the user selects a purchase order, it automatically selects the vendor and disables the field. If the purchase order gets unselected, the vendor field is cleared and enabled.
Solution:
make the fileds ->live() and put the logic inside the ->disabled(fn(Get $get)=> !$get('purchase_order_id'))

Access JSON and display in a table

Hey, probably I am overlooking something really obvious. I have a table and in that want to access a JSON that is stored in a database column in another model. When trying to debug with log::info it is displaying me the info correctly, but I am not sure how to let ->query use the data in the JSON My code for accessing the JSON looks like this:...

Relation Managers

why relation managers not working? I use the command: php artisan make:filament-relation-manager ProductResource categories name Product Model...
No description

Repeater and many-to-many (belognsToMany, morphsToMany) not saving

I have this issue where repeater cant handle belongsToMany or morphToMany relations.
Having this structure with Product, Option and a pivot table ConnectedModel, and after a lot of debuging I think Filament does insert the rows in the pivot table but it deletes it for some reason when using ->saveRelationshipUsing() , because is trying to save it again for some reason and there is no way as I see to disabled the auto relation save and allow only the manual save to avoid this. Product class...

How can save each step of a Wizard form when on next button ?

Hello everyone, I created a Wizard form and i need to save each step on clicking on next button. Any help please ?...
Solution:
You can use Step by using lifecycle hooks ->afterValidation(function () { // ... }) ->beforeValidation(function () { // ......
Next