Filament

F

Filament

A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire

Join

Breadcrumbs not displaying correctly on resource

My resource ``` public static function getPages(): array { return [...
No description

Tailwind Themes

Is it possible to have 2 themes in a css file: ```css @import 'tailwindcss'; @custom-variant dark (&:where(.dark, .dark *)); ...

419 CSRF Error on Livewire after migrating from Laravel 9 + Filament 2 to Laravel 11 + Filament 3

What I am trying to do: I'm migrating an existing project from Laravel 9 + Filament 2 to Laravel 11 + Filament 3. After the migration, I can see the login page, but when I try to log in, it refreshes and shows a 419 error on the Livewire POST request. PHP 8.2.12. What I did:...
No description

Custom fields based on page type?

Hi, i have a filament resource called pages. Each page has a type db column, eg home, about, contact or general etc. I want that for pages that are not general to have the ability to declare custom fields for them only. Eg, general pages have the post content text editor among many others but custom pages dont need the post content but custom fields only. I do not have many custom pages, max 5 atm but i would like to have a streamlined setup and not having to conditionally show/hide them in the resource....

Panel-wide authorization skip?

My admin panel is used as a way to manage content served via API routes to a mobile app. I have two authentication models in use, User which are all the app users and UserAdmin which are the users that have access to the filament app. I've already set this up to use class UserAdmin extends Authenticatable implements FilamentUser, and I have access to my filament panel with UserAdmins just fine. I recently implemented a model policy for my Article model relating to the API: ```php class ArticlePolicy {...

Repeater not working when placed inside Flex::make()

I’m facing an issue with the Repeater component and wanted to confirm if this is expected behavior or a bug. I have a Repeater field (for probation extension periods) inside a Flex::make() layout, basically to align them horizontally for a clean UI. Issue is: The first repeater item cannot be deleted if it’s empty. When I click the delete button, only field values clear — the row remains....
No description

Show preview of uploaded image in another part of the view

I have a FileUpload component that is ->live() After an image is uploaded, I want to display a preview of the file immediately on another part of the view (not in Filepond). When I dump the data of the form after it's updated, the image field contains a value like: ```...
Solution:
I figured it out: $value->temporaryUrl() Thanks anyway!...

Pagination number looks like a float

Hi guys, I have a weird one. I am now on Filament v4. I can't say if it was like this even on Filament v3, to be honest, but my pagination looks like with float values. 😅 As you can see in the image, for example, the last page is supposed to be "3630" or "3,630" (if we indicate thousand with a comma), but for sure not "3,63". I feel like it is an odd one because I don't think there is a real way to specify pagination to have "int" values. 🤔 Thanks in advance for any help. Cheers....
Solution:
I have found the problem. In Filament v3 I added "Schema::configureUsing(fn(Infolist $infolist) => $infolist->defaultNumberLocale('it'))" in boot but it wasn't working after Filament v4 update. In Filament v4 then I have changed that to "Number::useLocale('it_IT')" and that is effecting pagination numbers as well....
No description

Create / Save header action for all resources at once

I would like to move the Create and Save action to the page header for all resources. I know I can use: ```php $this->getSaveFormAction();...

Infolist not updating when form submitted on the same livewire component

I have a custom page with a form and infolist. The infolist displays data I get back from an API based on the inputted form data. When I call the submit action, nothing happens. A livewire request gets sent but no update to the value infolist entry. If I submit again it shows the previous search's data....

dd($record) always returns the first record, no matter which one I select

Hi everyone 👋 I'm having a strange issue in my Filament admin panel. When I try to dump the selected record inside a table action using dd($record), it always returns the first record of the table — no matter which record I actually click on. ...

Infolist is the same for all the records.

I'm trying to list courses in sections (instead of a table). But for every course it returns the same data (data of the last course) in the infolist. The header and the description of the course are displayed correctly. ```php public function content(Schema $schema): Schema {...
Solution:
Seems like I fixed it by adding ->state(fn ($record) => $record->the_attribute_name))to all the components in the infolist.

Upgrading to V4 broke some custom pages / tables

Hi all! Currently upgrading from v3 to v4, and we have some custom pages and table columns rendering custom blade files which are now broken as we are trying to use some filament components, which now seem broken. We have some custom pages, but now this blade file breaks: ```...

Error in upgrading to version 4.2

I am getting this issue while upgrading to version 4.2 ` Problem 1 - Root composer.json requires filament/filament 4.2 -> satisfiable by filament/filament[v4.2.0]....
Solution:
Problem Solved. It was composer problem. If you still facing this problem use composer self-update for composer update to version 2.9.1 (stable channel) .

Notification?

Hi, I'm trying to use notifications from laravel in my panel. This is my call: $order->mechanic->notify(new OrderAssigned($order, Auth::user())); As you can see, i have an OrderAssigned which extends a Notification. How can I use this to send a notification in filament? Is this even possible?...

Show only the first option and display '+N more' for the remaining options in the select

I tried publishing the form views to customize this behavior, but it didn’t work. Has anyone here tried customizing it before? Please share your solution if you have one!...
No description

After switching from Filament 3 to 4, I encountered problems with the layout of custom pages.

Hi friends! We recently decided to upgrade our corporate admin panel from Filament 3 to 4 and ran into a problem with the filament-pages layout. I'll attach screenshots below. Could this be related, and how can I fix it?...
No description

Filament Migration Issue

Hey team, I’m having trouble with Filament migrations — running:
php artisan migrate:fresh --seed
php artisan migrate:fresh --seed
...

Page without tenancy

Hi guys! I am looking for a way to build a custom page to let the user manage their personal API token. But I can't make it work that it is just "/api-tokens". It is always using "/team/{tenant}/api-tokens/". ...

Table with searchable() in Modal, pressing Enter closes Modal

I have a working table that is searchable in my modal, that is behind an Action. When I type in the search field all is well and the table is filtered, but when I press Enter, the modal closes. Is there a way to prevent this?