Filament

F

Filament

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

Join

Plugin causing Error on VIEW

I'm using Cheesegrits' Geocomplete plugin and when I view a record in panel model, it causes an error. Is there a way to make it conditional or have it work and prefilled like other form inputs?
Solution:
I ended using infolist to view data and solved the issue.

Multi-tenancy and Filament Imports

hi I am using spatie multi-tenancy package. I am currently have a feature that is being develop regarding import. I am using Filament Import. I've already implemented the custom imports jobs based on Filament Imports Docs. Now, my issue is I cannot pick the job from the job table because the there is no selected database yet according to my log. May I know how can I handle this?...

FileUpload in form resets form fields on upload

I have a form that contains a FileUpload field. It works fine, except when a user fills out the form, and then subsequently uploads a file, it resets the fields on the form to their defaults. So you have to remember to upload the file first, then set your form fields, then click save. ```php Radio::make('my_radio_field_that_gets_reset')...

Managing 3 levels (or more) deep relations.

Hey guys, I was wondering how you would handle this business case in terms of UX. So with 2 levels it's easy. Relation manager on one resource. ...

Markdown editor height

Does anyone know how to give the markdown editor a max height and make it scrollable. Just giving it a height css class does make it that height, but the editor area itself is then not scrollable and as such becomes impossible to use. I have a really long markdown document that makes the page impossibly long to scroll down to save, and whilst I know the ctrl or cmd and s, the users of the app do not.
Solution:
->maxHeight('300px') ?

Duplicate and missing records/rows when navigating table pages

I was looking for a record in an "Orders" table, that I new existed, and I wasn't able to find it while navigating the 10 record per page table pages. I then set the table to show all records, which revealed the record I was looking for. Also, when navigating between pages, I see the same records on different pages (see screen recording) When setting a filter for the order date, for some reason, the record shows on page 2 when navigating the table pages, and the same records don't appear on different pages. Does anyone know why this is?...

Limit display of entries in table

Hey, I know there is probably something overly easy I am overlooking, but I can not figure it out... I have made a widget displaying a table, but now want to only show the 5 most recent records. How can this be done? I first thought about limit(), but its not working. ...
Solution:
Figured it out. I used ->latest()->take(5) on the query...

Fileupload to AWS S3

I'm trying to store images on AWS S3. The moment I upload an image it creates a folder livewire-tmp (with the image inside) in the bucket in AWS S3 in it. So far so good....However, the moment I press the create button in Filament, it writes it to local disk (and livewire-tmp folder is gone at AWS S3). Despite the below configuration. Am I overlooking something? .env file `FILESYSTEM_DISK=s3 AWS_ACCESS_KEY_ID=A***A...
Solution:
Not 100% but I think s3 needs ->visibility('private') 🤔

Custom register page (register link on login page)

I created a custom registration page that's by invitation only. On the login page, it currently says "or register here." I need to remove this. Should I publish the views, or is there another way to do it?
Solution:
ah so you kinda need both, I guess publishing the view to remove the link, or override the $view of the login page

How to get selected filters in filtersApplyAction?

I have 8 filters that can be applied, I want to save the applied filters in localStorage, when the user clicks on Search button. How can I do that? (I am trying to save so that the user can have previous filters selected whenever the table is viewed again(even after being logged out)). `->deferFilters() ->filtersApplyAction( function (Action $action) { return $action...
Solution:
I got the work around for this: `->filtersApplyAction( fn (Action $action) => $action ->button() ->url(function (Table $table) {...

Isolate CSS in BlocksPreview

I am creating previews for a "Builder (blockPreviews)" form with the new filament function. But it turns out that it inserts the blade view as is in my panel and I need to use the styles of my "front" and ignore those of filament that I am using as an admin panel only. I thought about creating iframes but there I should solve the way I send the props and the load would be slow. Has anyone considered this problem before?...

Media library manager no access after payment

Help! Just bought Media Library Manager but no email or login access. Payment went through. Any ideas? @ralphjsmit
Solution:
i'm got the reset email and i can login now and i can download the library thanks a lot

Forms hint opens a modal

Textarea::make('description')
->hint(OPEN A MODAL)
->required()
Textarea::make('description')
->hint(OPEN A MODAL)
->required()
...

Custom Field disappear after LiveWire update

One dev in my team created a PracticeMatrix custom field. Everything was working fine until I added ->live(onBlur: true)->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))), to a TextField to automatically generate a Slug in TextInput::make('slug'). Now, when I blur the TextField, most of the BestPracticeMatrix component disappear and I don't know why. The controller or the blade view are probably not correct, but I'm not familiar with LiveWire and filamentphp custom field....
Solution:
I guess so, first time using filament and livewire, and this code wasn't from me. But it kinda feels wonky to call PHP methods from the template 😬 Seems like it should be in the Controller and passed down, but that's where it reset the array when LireWire update. But i'm very unfamillar with how to pass data from the Controller to the field, there is basically zero documentation about that. Only how to do a very basic ViewField::make()...
No description

help

cannot see values , only labels why ? if remove index from here return TextInput::make("{$prefix}_{$index}") see fullstring [.] is divider ...
No description

Theoretical/Performance Question

Let's say I have a livewire component that's a list of items. The list has a foreach loop that iterates through livewire component items in the list. So something like this: ```php...
Solution:
Definitely 3. Otherwise you’re going to have n+1 issues. But I say that not knowing the functionality of the repeated component.

Filament custom rules, in rules folder or forms/components.

Hi, I need to reuse some rules in a filament resource and I was wondering if I should put them in the default Laravel rules folder or the app/forms/components folder. Thanks

Table: How to position bulk action checkbox?

Hey there, is it possible to change the position of the bulk action checkbox? Like placing it at the end of the table? Imagine something like Todolists in a table where each task can be marked as completed (see Screenshot). The checkbox for bulk actions and the checkbox to set a task as completed are close together which could be a UI/UX problem - especially on mobile devices. Is it possible to change the position of the bulk action checkboxes?...
No description

Unable to find component when clicking on an action

I have a custom action in a custom Filament page: ```php // ......

Hint action disappear.

```php Forms\Components\Select::make('client_id') ->native(false) ->preload() ->live()...
Solution:
```php Select::make('client_id') ->options([ 1 => 'Option 1', 2 => 'Option 2',...