Filament

F

Filament

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

Join

`Typed property Filament...Component::$container must not be accessed before init` from custom field

I have a custom field that I am calling from within the form scheme of a panel. Inside it I have cave a computed property that returns some inputs, I would like to make use of filament's form components though, to keep everything more consistent. If however I do so, I am greeted with the following error: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization The code that produces the output is this: ```php public function makeFilterField($filter) {...

In Form Builder - Relation is failing to save. Presents SQL error.

When saving a resource that has a relation with another resource, it looks like it saves the resource, however presents this SQL error. Also attached at pictures of the models being used, with their relations. The form is using relationship('host', 'name') as the way to relate the 2 models via the form. (This does present the data correctly, and seems to store it correctly as well, but it's acting as if it needs to update the User Table, when it has no real reason to update that? Maybe I have something set up wrong. When trying to use this in a front-end using Livewire, it for some reason isn't caring what is stored for the host. I'll open another help post if that is needed....
No description

I don't know how to add a custom icon to the header.

I don't know how to add a custom icon to the header.
Solution:
in genera that can be done using the render hooks https://filamentphp.com/docs/3.x/support/render-hooks#scoping-render-hooks...
No description

error installing filament

i have installed laravel 12 but then when i try to execute this
php artisan filament:install --panels
php artisan filament:install --panels
then the adminPanelProvider has been installed. ...

Custom page with parameter (independent from resource)

hi guys, im trying to create a custom global page that can take a record id from url for me to process, i dont want it to be bound with a resource since its independent page also im working with multitenant, this is my current code ```php...

Export - failed rows

I have a few exports, which works mostly fine. But in some cases, in the notification, I am getting .... (Number1) row exported. (Number2) row failed to export. ...

Custom Column View Tables Overflows

I created a custom column view for Filament Tables that displays a user's profile image next to their name. The layout works, but I’m facing a strange issue: the text sometimes overflows or misaligns, as if the container doesn’t account for the width of the image. It feels like the text is being rendered outside the expected width or the parent container isn’t fully wrapping both the image and the text properly.
No description

Filament Shield: 403 Forbidden on Production but Works Fine Locally

Hi everyone, I need some help regarding an issue I’ve been facing with Filament Shield in a Laravel project. We’re using Filament Shield to handle permissions for our admin panel. On local development, everything works perfectly. After migrating the database, I run: ```php artisan shield:install...

How do I add a select field to my sidebar?

How do I add a select field to my sidebar? I'm using tenant and I need to add a sub-selector below it......

How to display a file uploaded in a previous step in a Filament wizard form (before submission)?

I’m using a multi-step (wizard) form in Laravel + Filament. In the first step, the user uploads a file using the FileUpload component. Is it possible to access or display that uploaded file in a later step (e.g., a Review step), even before the form is submitted? ...

Is there a way to remove the theme switcher and just have dark mode?

My users are extremely limited and my client is picky. They do not want the light mode feature. Can we just serve a single theme, dark mode, and remove the switcher??? Thanks.

Populate Select with only a select subset of an enum

What I am trying to achieve is populating the Select with only certain values of an Enum based on permissions. It is likely I am approaching this entirely the wrong way, and have tried various solutions without success. Although this does not work, it shows what I am trying to achieve. The ArticleStatus is a backed Enum and the value of that enum is stored in the status attribute (it is casted). Everything works properly if I want to load all the values of the enum (->options(ArticleStatus::class)). ...
Solution:
So you could map the allowed enum cases to key/value pairs (enum value as key, and label as value) for ->options/icons/colors: ```php Select::make('status') ->selectablePlaceholder(false)...

import from csv into multiple related tables

Hi folks, Sorry for asking but I'm really struggling to find any definitive documentation on how to implement this and I'm not even certain that's even possible at least with the ImportAction from Filament. I have a csv with data we've broken down to be distributed into 6 different tables. I understand the relationship model in the Import action is still in its infancy and only supports belongs_to relationships. However I figured even with that there's no reason I couldn't manage to make my objectives work. So what I'm trying to do is this:...
Solution:
@Jean-Loup can you pass in $data? and try this to see if $data is populated. ```php use Illuminate\Support\Facades\Log; ...

issues for laravel 12 fresh installation with filament, copyable or tenant selection

I had tried clear caches, node_modules and vendor folder. two issues, copyable function and when click on new tenant registration for add new tenant.
No description

Set custom data on RepeatableEntry

I need to set custom data on RepeatableEntry: ```php Tables\Actions\ViewAction::make('generateNewsProd') //Esto para produccion ->hidden(fn(Model $record) => !$record->notifiedPapers)...

Can't download PDF using Spatie Laravel-pdf

I'm trying to use Spatie Laravel-pdf to generate PDF with the use of Tailwing and tried following the docs https://spatie.be/docs/laravel-pdf/v1/advanced-usage/using-tailwind . However, after installing puppeter I'm still getting problem (pic related). I've read https://github.com/spatie/laravel-pdf/discussions/57 and tried doing the same in my app.dockerfile since I'm using ddev container to launch my app. ```...
No description

Edit Choices.js configuration

Hi, when I create a Select component with HTML options, the search function does not work well. This is because the search is performed on the label, instead of the value. When I set the Choices.js configuration option searchableOptionFields to value instead of label (in Chrome dev tools), searching works fine. Is there a way to change this?...
Solution:
this an old artical but you can adjust it to make work with v3 https://v2.filamentphp.com/tricks/render-html-in-select-options combine getSearchResultsUsing and getOptionLabelUsing...
No description

Adding tabs to a table on a custom livewire component

Hi, Is there any way of adding tabs to the table of a custom livewire component? Can't seem to find anything on the docs. Only examples I see are in the ListRecords, Infolists, etc....

Error npm run build

I want to deploy my laravel 11 app in AWS ec2, after i execute npm install, composer install, i wanti to build my nodejs, but i got this error, i dont know why this is happend in my server ```vite v6.2.0 building for production... ✓ 1 modules transformed. ✗ Build failed in 26ms error during build:...
No description

How to hide filter options and use only the search?

I've got a table with >60 k entries, thus the filter options of the select filter take a long time to load. Practically, I don't need the 60k options available in my select filter. All I will use is the search function. Is there a way to optimize load time? ``` SelectFilter::make('number') ->label(__('filament.warranty_no'))...