Filament

F

Filament

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

Join

Multiple resources using same model not working

Hello! I've got a User model, with an attribute usertype, values 1=Admin, 2=User, 3=Worker. This works, initially I had a single resource to manage these. I've been trying to split it into separate resources, i.e.: AdministratorResource, UserResource, and WorkerResource. However, no matter what I change or try all three of the resources end up showing the users. I've tried creating a separate Administrator model, I've added an override for the EloquentQuery: ```...

How can I aggregate a field on a pivot table with TextColumn->sum()?

My code: ```php TextColumn::make('locations_sum_available_quantity') ->label('Inventory')...
Solution:
Figured it out. Tinkerwell to the rescue. Solution:...

How can i trigger model events when changing pivot table

I have a filament select going like that : ```php Forms\Components\Repeater::make('songArtists') ->relationship() ->schema([...

Tabs to sidebar view

Hello community 👋 Is there a way to place tab names to left side?...
No description

Pass string to widget

Hello Is there anyway to pass a parameter (a string) to a custom widget on getHeaderWidgets? Thanks...

Can't keep modal open

In the filament php docs there is this thing if ($arguments['another'] ?? false) { // Reset the form and don't close the modal }...

Filament Undefined table in tenant panel

Hi I am using Laravel 11, Filament with tenancyforlaravel. I am using Postgres with seperate schema for each tenant. I can verify the schema and table exists in tenant but not in central app. So the issue is, filament is using the central db not tenant. ...
Solution:
Solved I had the wrong subdomain in db. it should only be the subdomain not the fqdn

Production-only problem with FileUpload - on first upload the state is reset

Hey there! FileUpload triggers one more update livewire request after successfull upload and resets the state to empty. (checkout provided video) Valid upload (local):...
Solution:
It sounds like the delployed code ins't mounting the form first for some reason... usually $this->form->fill() on mount

installling project problem

hey there i am trying to create a new project with filament using laravel 12 i created the laravel project then i did the command
php artisan filament:install --panels
php artisan filament:install --panels
after i ran the composer i did this command
composer require filament/filament -W
composer require filament/filament -W
...
No description

No way to add sideeffects to ToggleColumn?

I am making an admin panel to interact with another API. When the user toggles a ToggleColumn switch, I want to conditionally allow the state change depending on the API. Unfortunately I can't get any kind of conditional state change on ToggleColumn. I have tried updating the event after state is updated. ```...
Solution:
Sounds like an issue with your model then. Not Filament. Is the field fillable?

Why is my content so wide

I am confusion to why my login is full width. Here is my blade view ```php <x-filament-panels::page.simple> ...
Solution:
So just had a brief, I just temp renamed the simple.blade.php from resources/views/vendor, it fixes the view. So not sure what the issue entirely was as the simple.blade.php wasn't edited by me (that I can remember) ```php <x-filament-panels::layout.base :livewire="$livewire"> @props([...
No description

File upload and text input in action modal

If I have a file upload in action (modal) and a text input field in the same form. If you upload a file and start writing to the text input while that file is uploading, the moment the file uploads will delete some of the last typed characters from the text input field. Anyone else see this issue? Is there any workaround?...

Using json properties for form schema

I have a form that uses a model on laravel with a json column. Inside there are some properties. There are tags and difficulty level inside but when saving, it overwrites the whole json instead of just changing the correct property. A simple example of a json column value (column name is metadata): ``` {...

Build repeater schema from action

How can I build / add / create a repeater schema when the user clicks an action? ``` Actions::make([ Action::make('generate_variations')...
No description

Modal form validation not working either.... what is happening

```return Section::make('Sytescope Account') ->description('Load your Sytescope API Key. API Key can be found in your project under settings -> Applications API Key.') ->schema( [ TextInput::make('name')->label('Title') ->minLength(3)...

$component must not be accessed before initialization. Trying to use a modal with table edit button

Trying to use a modal from the table row button. Form loads fine as long as I don't try and access the livewire component ->modalFooterActions([ FormAction::make('Save')...

Custom Modal Action is making a post to 'update' instead of running method.

``` Actions::make([ Action::make('Save')->action(function(){ $this->save(); ...

Reorder between Builders

Is it possible to allow reordering between two builders? If block is created in the first one to be able to also be moved in the other builder. Current code: ```php...

Pivot-Table with Morph-Relation?

Hello, I have a Contract Model with a ContractResource and a Cluster Model with ClusterResoruce. Now I have a pivot table betweem them called cluster_contract with some normal attributs. Working just fine to attach them, edit pivot columns, etc. No problems here. But now, the pivot table clust_contract, has again a morph relation to the model "County". So, I have a table clustercontractable with cluster_contract_id, _type, _id, columns, etc.....

Grouping month year and group summarize (total amount)

I couldn't figure out what I do wrong. grouping expenses by month-year works but when I want to show summarize on each month, sum is wrong Here is my Code ```...
No description