Filament

F

Filament

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

Join

How to see the file uploaded using ->url()?

I already linked my storage, so it was on public/storage and I know laravel have a safety about accessing the url of public/storage. I would like to know how can I access the file via url as logged in user?
Solution:
TextColumn::make('document')
->url(fn (YourModel $record): ?string => Storage::url($record->document))
->openUrlInNewTab()
TextColumn::make('document')
->url(fn (YourModel $record): ?string => Storage::url($record->document))
->openUrlInNewTab()
...

Troubleshooting CSV Import

I am trying to use the new CSV import function in Filament 3.1 but I only get the very unhelpful error message: local.ERROR: Multiple types of exceptions occurred: [ErrorException], [Illuminate\Database\QueryException] {"userId":1,"exception":"[object] (Exception(code: 0): Multiple types of exceptions occurred: [ErrorException], [Illuminate\\Database\\QueryException] at /var/www/html/vendor/filament/actions/src/Imports/Jobs/ImportCsv.php:174) What can I do to get more fidelity on what errors are actually occurring or what I'm doing wrong with the Import action?...

Error with updating a post request -(CSRF-token) - Livewire/update

What I'm Trying to Do: I'm creating a settings page using the Spatie Laravel Settings plugin. What I Did: I recently resumed coding after a 5-6 month break. The last time I coded was with Laravel 10.10, right before Laravel 11 was released. Transitioning to Laravel 11 has been very challenging, especially with the structural changes in the framework. Previously, I had everything working just fine in v.10.10. However, since the update to Laravel 11 and the changes to the app folder, I'm encountering issues. Specifically, I'm receiving a CSRF error, and the POST request isn't updating as expected....

How to open selected image on ImageEntry into a New Tab ?

i try this, but error : Infolists\Components\ImageEntry::make('images')->grow(true)->circular()->stacked()->disk('progress')->openInNewTab(),...

searchable() - accessing the search terms entered / context of results

Hi is it possible to access the search string entered in the free text box? I'm interested in being able to pull out the context of the data where the entered search terms match, It seems like a very clever bit of coding within Filament which enables matching using the entered words even when the words are not consecutive. My objective is to be able to show the user (ideally in a column in the "table view") the underlying data on which the match was made (context). For example the user types in "table mountain" and the context might be "The walkers hiked all the way to the top of Table Mountain in the searing midday heat" - so would be great to be able to pull out x words before and after the search term. Is such a thing possible?...

Breeze profile & dashboard page in filament

Hi i am using Beeze from my filament login and register and it is working well. The issue is I want to have the default profile page in filament or rebuild it in filament and remove the default breeze dashboard page, is there a best way of doing this? Thanks

Table `deferLoading()` calling `loadTable` method twice.

I have enabled deferedLoading() however two calls to the loadTable seem to be made on page load. Is this expected behaviour?

Checkbox list

Hello everyone. I have columns named "name" and "attachments" in the same table. I show the "name" field in "options()" but I don't know how to show the "attachments" field in the "descriptions" field. The "attachments" field in the table is in json format...

ExportColumn date format

Is there a way to fix a date format into a specific format - like m/d/y H:i when exporting? I have reports that show the date in one way but then when they export the end user is getting 24 hour military times . . . I need an easy button for them.

How to order naviation groups

Hi everyone is there a way i can reorder navigation groups for now if i am using the navigationSort is not working

Grouped row in Filament together with action

I have the following table in Filament: ```php public function getIncentiveRequests(): Builder {...

Infolist TextEntry with enum casted attribute

Hi, how can I display an enum value when it is cast to an enum class in an infolist textentry? Im getting Object of class enum could not be converted to string. Also how would I display multiple values using AsEnumCollection::class:EnumClass cast?...
Solution:
https://filamentphp.com/docs/3.x/support/enums#using-the-enum-label-with-a-text-entry-in-your-infolist If you use a TextEntry with the Infolist Builder, and it is cast to an enum in your Eloquent model, Filament will automatically use the HasLabel interface to display the enum's label instead of its raw value....

Can update password but can't see it in edit page

I am using filament 3 shield and when I create text input make('password') I can not see the password, I can update but I can not see it. How to make password visible on the edit page?
Solution:
Laravel provides secure hashing for storing user passwords. I recommend sticking with the default and not displaying passwords to users
No description

Filament Table tab

I'm trying to apply a condition on the Filament table tab so that when is_archived = 1, it should display in the 'Archived' tab. However, it's not working in my case. I've attached the code for your reference. ```<?php public function getTabs(): array {...
No description

Performing action on resource view event

Hello, I have a ContactResource. It contains data from the contact form and is saved as is_read=false by default. I want to make is_read=true when this resource is opened with view in the admin panel. How can I do this? In the documentation https://filamentphp.com/docs/3.x/panels/resources/viewing-records I couldn't find anything related to what I want to do on this page, or I didn't understand it.
Solution:
```php public function mount(int|string $record): void { parent::mount($record); $this->record->update(['is_read' => true]);...

Custom field with HasAffixes trait

Trying to set up this custom field and want to add a prefix $ icon. I can't seem to get a prefix to work on this field and wondering what I'm doing wrong. ```php use Filament\Forms\Components\Field; use Filament\Forms\Components\Concerns\HasAffixes;...
Solution:
You need to pass the prefix to the wrapper since you’re in a custom view. See https://github.com/filamentphp/filament/blob/3.x/packages/forms/resources/views/components/text-input.blade.php

Not all Select options are displayed

If I have a list with up to 100 options in a selection, I cannot see all of them in the pop-up list. Any tip to fix?

how to make roles accesible only to admin in filament shields

i am working on an erp where mutliple users have access to the same panel, and i wanted to make an rbac but allow only the admin to see and use the filament shields along with assigning the roles to users.

Give default value to TextInput when Edit Data

This data is not in the same table so I have to get the data first in another table Now from the data I took I want to give a default value in TextInput::make('custom_name') How do I do that? class OrderResource extends Resource...

Need help in logic of ->afterStateUpdated()

I'm trying to update the net proceeds when the $state has change, it adds up a lot of value and I don't know where does it come from . Let's say the existing value of net proceed is 22,944 and current interest value is 306 . When I change the interest value into 307 it adds for about 251 ``` ->afterStateUpdated(function ($state, $set, $get) { $set('insurance', $state); ...
Solution:
If the field reactivity is working, the issue is likely with the calculation you’re performing