Filament

F

Filament

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

Join

Enable disabled button after creating related item

I have the following action on my resource, and as you can see it is checking if the record has 1 or more rounds connected to it. In the gui the action is displayed above the table where the rounds are displayed via a relationmanager. Can I make this disabled/enabled state change interactive, so I dont have to actually reload the page after adding another round(s)? Any help would be much appreciated. Thank you in advance. ...

Adjacency List plugin is not compatible with multi language?

Hello, I’m trying to use the Adjacency List plugin with multilingual support through tabs, but I’m encountering an error when using the reorder function. I followed the suggestions in the documentation, but I couldn’t achieve the desired result. The error I’m getting is as follows: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization...
No description

Where to Inject a Custom Action in Filament EditPage After Policy and Validation Are Passed?

Hi everyone! 👋 I'm currently building a custom UpdateUserAction and would like to integrate it properly into a Filament EditRecord page. ---...

Variable inside forms Action->action are stuck to first iteration, when I'm creating it in foreach

I'm trying to make dynamic action button generation for multiple situation (based on type). But for some reason all buttons generated by this snippet are leading to a "One Image" case. What interesting - all image have their heroicon and label, so foreach actually generates multiple buttons, but with absolutely same action. How can I parse necessary type ($key) inside ->action()? ''' // 1) Combine labels & icons in one array: $elementTypes = [ 'one_image' => ['label' => 'One Image', 'icon' => 'heroicon-m-photo'], 'text' => ['label' => 'Text', 'icon' => 'heroicon-m-document-text'], 'quote' => ['label' => 'Quote', 'icon' => 'heroicon-m-chat-bubble-bottom-center-text'],...
Solution:
It's likely because your action name is enclosed in single quotes so the $key is not being treated as a variable. Try:
"addElement_{$key}"
"addElement_{$key}"
...
No description

Route not found for Filament Resource Page

I'm an experienced PHP/Symfony developer, my experience with Laravel and Filament is very limited. I apologise in advance for a trivial question. I created a new Resource, with two pages: index, and issue. Autodiscovery seems to work fine, when I run the route:list command from the command line, I see the routes: ```bash $ php artisan route:list | grep premiums...
Solution:
I deleted bootstrap/cache/filament folder and now it automagically works...

Moved resources to Admin folder and auto discovery is broken

I have two panels Admin and Account. I tried moving the Admin resources into an /Admin folder, I updated all the namespaces and discover* paths in the panel provider. The dashboard loads but no resources are auto discovered. Also, if I run artisan make:filament-resource SomeResource and select the admin panel the generated file’s namespace end in a slash namespace App\Filament\Admin\Resources\; ```php...
No description

canEdit() (etc) on Filament resources

Hi all, I think I am being dense but I cannot find any documentation in Filament v3 around the canEdit, canDelete, etc. methods on a filament resource within a dashboard A typical location for what I am talking about would be App/Filament/Admin/Resources/SpecificResource.php Can anyone help point me in the right direction?...
Solution:
also see if there is anything else I should consider.
Try to stick to policies as much as you can. Is there a reason you need to overwrite the behaviour in Filament?...

Conditional createOptionForm in Filament

What I did: ``` Select::make('user_id') ->label('Team Owner')...

RichText with re-sizeable images

Has anyone nailed rich text forms with copy and paste and re-sizeable images? I've tried the onbaord rich text, plugins with tiptap editors, tinymce, quill..... Nothing seems to do everything. Am I missing something obvious ?...

Filepond Issue

Anyone have knowledge about filepond library?????

Filamentphp Theme

Anyone have tried to install / setup custom theme in filamentphp? have tried in so many ways. no luck
No description

Get filename and path after a file is uploaded using afterStateUpdated

I'd like to get the filename and path after a file is uploaded using afterStateUpdated. After the file is uploaded, but before the (create) record is saved, I can see the file in the livewire-tmp folder, but how do I get to it programmatically? (I want to convert a PDF to text at this point) I've searched diligently for code examples on accessing file upload details using $get or $component in an afterStateUpdated handler, but getting nowhere. Seems like something that should be easier to find. Please advise...

Can an widget open a modal ?

Hello. i created a Custom Page. Then, i created 2 tests: 1. Action button inside getHeaderActions() to open a modal. It is working. 2. Created a Custom Widget and tried to open a modal when clicking a button. it is not working....
Solution:
Yes, just follow the actions docs. A widget it a livewire component.

How to get the right statePath?

I have a form with a statePath: ```php Section::make('My Section') ->schema([...

S3 disk config

Hello everyone! Can you help me use an s3 disk in Filament? I'm trying but I get the error: Unable to check existence for. Here is my filesystem configuration 's3' => [ 'driver' => 's3', 'key' => env('AWS_ACCESS_KEY_ID'),...
Solution:
Sorry, never worked with supabase and s3 so not 100 sure. But any s3 connection needs to be a private visibilty even if the bucket is public. Hopefully someone else has some more experience and can help further.

Use Filament login to access a non filament page

I have a Livewire component with a Filament form inside. I would like to make user login before they can access this form. I don't have any Laravel starter kit, so I was wondering if I could simply use Filament login... If it's too hard I'll install Breeze....

validation.required error after update filament

Hey guys i have an error after update, i check all my code and at the moment all look ok... i don't see any problem, however in the front, in the form i receive the error message validation.required. and example of this is a toggle here is my migration ...
Solution:
Yesterday I had the same problem then and applied as a solution to use cluster, I have a form in which I add or create new categories of services but I got a similar error ... then I checked, checked, found out, used AI, and nothing, it only occurred to me to jump to create the category in a model and resource apart and from there call it in the other resource, but now I see that it persisted in another resource, well the one we saw now ... It is strange if on the one hand because this has not h...
No description

->requiresConfirmation() on a button on the blade

Guys, is there any way to add the ->requiresConfirmation() to a button in blade?
Solution:
Thanks, I managed to do this: ``` public function deliverAction(): Action {...

php artisan filament:assets broke my dropdowns

[URGENT] Hey! It's my first time working with filament and I wanted to edit my action buttons directly in some way. I ran the command from the title and my dropdowns on a specific Post.php form started bugging HARD. Like they still show the data but visually they're really broken and you cannot really select anything on there. I've tried reverting that command and on localhost it works fine now but on prod it works 50/50 sometimes it's fine sometimes it's busted. How would I revert all the assets to before php artisan filament:assets since I actually haven't used that at all? ...
No description

Create related resource with another relationship

I am making an app to record games, rounds per game, and scores per player per round. I now have a GameResource with a RoundsRelationManager. On the Game's Edit page I have a table with the rounds and a button to add a new round. I want to open a modal with a form to create a new round. The modal should have a form with the following fields: - Round number (property of the Round model, must only be visible and is a calculated field) - Points per player (property of the Score model that is connected to the Round)...