Filament

F

Filament

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

Join

Display some fields only on item-edit or item-create pages

Is there a way to let some fields only appear on edit pages, and some other fields to only appear on create pages? Currently whatever displays on create page also displays on the edit page, because they are both based on public static function form(Form $form): Form { ... of the Resource file....

Unable to locate file in Vite manifest: .../admin/theme.css

This is what I have in the Vite config file, the path to the admin/theme.css file is correct (theme created using artisan command). import { defineConfig } from 'vite'; import laravel from 'laravel-vite-plugin'; import vue from '@vitejs/plugin-vue';...
Solution:
Found out why, in AdminPanelProvider I was using the absolute path to the admin theme.css resource. It requires the relative path only!

Problem with bulk selection in custom page table

I'm using filament table on a custom page. If I select bulk data, and I choose to select all, why is it only selected the first row? What am I missing?...

conditioning using activeTab not working as expected

I was expecting that when having this conditioning will not show only on "All" tab. However, it shows on every tabs. I am wondering what I did wrong where. thank you.. ```php Tables\Columns\TextColumn::make('original_name') ->hidden(fn ($livewire) => $livewire->activeTab !== 'All')...
Solution:
You used null as a Key for the "All" tab not "All".
No description

How is demo.filamentphp.com deployed?

I was wondering how filamentphp deploys their demo site because it feels so fast when accessed. For comparison, I use aaPanel (nginx) on a VPS with 8GB RAM. It takes 3.09 seconds just to load the default dashboard page without dynamic widgets. While demo.filamentphp.com only takes 900ms to load the dashboard containing dynamic tables. So, is the demo using a container or using a panel-based service like cPanel, Plesk, etc.?...

Custom CSV Importer file

In a CSV import action, is there a way to have a row with the factory ID, and then use this ID for all created products?
No description

Dynamic label for repeaters

Is there a way that I can give a dynamic label to each item in my repeater? Currently when i set the "label" it sets a top level label but each item in the repeater has a blank bar between the order and delete icons.

Custom page before list resource

I need to add a custom page before listing a resource. I tried something like this: ```php public static function getPages(): array {...

How can I use Filament components like the table in a regular Livewire application?

I'd like to use some of the components from Livewire such as the table with pagination and all, maybe customizing the styles to my own spec. I can go through the code and pick out what I want but is there a simpler way to get those components into my own Livewire app? For example the base Laravel Breeze Livewire application.

deferLoading

Is there any simple way to actually deferLoading on the table data until filter is applied?
Solution:
You could modify the table query until a filter is selected: Something like this (you need to figure out check_if_empty ```php...

importer resolveRecord() not running?

According to the docs , the function
resolveRecord()
resolveRecord()
runs for each line in the CSV file. It is not running for me. ```public function resolveRecord(): ?AppType { logger('resolveRecord()'); return new AppType();...
Solution:
The import is running on the queue, right? Did you restart the queue worker after making that change?

Disable specific relationship operations on form

I'm tring to create a form for my table Endereco.
Endereco belongs to Cidade Cidade belongs to Estado Im am using 'cidade' relation just to load data from database in my 'estado_id' input, but i don't want to change anything about this relationship when sending the form. I tried to pass false as second argument of relationship() method, but it tried to delete the row instead of doing nothing. ...
Solution:
it's working using dehydrated(false), now i'll look to another way

Testing filament resource table got an error

I got an error when testing a filament resource table like that! I don't know why?. I just copied the code from filament resource testing documentation. ``` lse,"except":null},"defaultTableActionRecord":{"as":"tableActionRecord","use":"replace","alwaysShow":false,"except":null},"paginators.page":{"as":"page","use":"push","alwaysShow":false,"except":null}}}" wire:id="7e0WsZp5wPL6t4HSQntg"\n class="fi-page fi-resource-list-records-page fi-resource-categories"\n >\n...

Custom Tab component

Hi, is there a way to extends Tab class and make custom form component, am tried like next ` use Filament\Forms\Components\Tabs\Tab; use Filament\Forms\Concerns\InteractsWithForms; use Filament\Forms\Contracts\HasForms;...

How to bypass database violations?

I have a table with unique index, I am trying to update the model in a try-catch block $exceptions = 0; try { AssetDepreciation::updateOrCreate([...

Conditionally showing TextInput or changing default

I want to show a different default value in the TextInput depending on the organization_type. I have therefore created two TextInput fields. I hide the TextInput depending on the type of organization. As such this works, but I also need the default value to be different depending on the organization type. While the TextInput is correctly chosen (e.g I can see that on the label), the default value of the first TextInput is always shown. So concrete: I have two types of organizations (e.g. an individual and a company). When organization type is individual, I want to show a textInput with the name of the individual. When organization type is company, I want to show a textInput with default value of the user name, with "'s Company" added to the default value ...

Force refresh a Select to update disableOptionWhen()?

Hey, I would really apprecaite some pointers in the right direction here, I've tried absolutely everything I can think of. In my Select implementation, I am trying to Remove/Disable options in real-time based on current selection. The code below works, however, the options are only updated when you exit focus from the Select and click on it again. ...

How to refresh a relationManager after Action on Owner.

Hi. I have an ISSUE tracking system. In the viewform of the Issue, I have an action to change ISSUE priority. It opens a modal with a select for the new priority. Then, the action updates the ISSUE and adds a record to the "activities" registering that change. The view has a relationshipManager with all the activities of the ISSUE, I can refresh the "priority_id" field of the view (since it was modified) but How can I refresh the relationshipManager to show the new record?...
No description

is there a way to manage relations in infolist entry?

I cant find any relationship related on infolist docs.. and when debugging my entry. it seems that relationship is not showing.. even if I am sure that I have relationships data.. is this expected? or I messed up?