Filament

F

Filament

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

Join

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

Conditionally add and update relations

Currently I got this situation. A user can have only 1 shipping address and only 1 billing address. In Filament's admin panel's user form, admin can change user's info. However I want to set restrictions, so that admin cant give a user >1 address of type shipping, and cant give a user >1 address of type billing. That also implies that when the user already got 1 billing address, the admin can't change that user's shipping address to type=billing....
Solution:
Create a policy according to the laravel docs then handle the conditions in each method based on your apps authorization. Filament defaults to Laravel’s policies to handle model authorization. https://laravel.com/docs/11.x/authorization#creating-policies

single record edit

Going off this tutorial: https://laraveldaily.com/post/filament-edit-only-single-record-custom-page I have a working form on my FilamentPage. However the related select field doesn't populate. This all works great in the actual admin Resource. But not on the other side where a user logs in to edit one record....
Solution:
->model($this->user);
->model($this->user);

ListRecord, getTab with badge count with filter

Hi. My ticket resource let's the user filter the table. How can I get the filters of the table from the getTabs in ListRecord to count filtered records with a certain status? Thanks...

Filament Modal

I have a custom page contain button on click on that button i want modal to open i tried to use emit but it doesnt work my blade code ``` <x-filament-panels::page>...

I want to generate dynamic ExportColumn!

Is there anyway to access $record inside getColumns(), in my case, I want to generate dynamic ExportColumn! i.e., if I have a JSON field, I want to break it down to multiple columns while exporting.

Repeater Relationship New Entry doesn't show until refresh

Hey, I am using a Repeater linked with a relationship within a UserResource, when adding a new entry to the repeater and saving, the new entry doesn't show until I refresh the page manually. Is there anyway to have it show without refreshing?...

Data too long for column for "string"

I already understand that the error is because a string that is too long was entered and that it can be solved, for example, by adding "->maxLength(255)". However, my question is, shouldn't the maximum be 255 by default? 🤔...
No description

Back to default within method

Hi, If I have the following code: Forms\Components\FileUpload::make('image')...

FileUpload for Cloudflare Images

Hi, I have a Forms\Components\FileUpload, and when editing, I want to show an image in a URL (not in the disk), something like: `Forms\Components\FileUpload::make('image')...

Adding a repeater to the record view page. Is it possible?

I want to add relationship form in view page. I want to add new records of contract realization with multiple entry. I cannot do it by modal becouse with it i'll create just one record. Is such thing is possible? Or somehow adding a repeater to the modal that will create several elements in a relationship?...
Solution:
i've change the save to database action with action "using"

Custom card component in a form

Hey folks, I'm trying to create the design from the attached image, more or less. I want to add cards like in the picture to a form. The cards need to be selectable, and I want to have a small play button where users can preview the selection (it's audio), and once happy with it, click on the card and have it be selected....
No description

Sub-navigation hidden on mobile - how to display it instead?

The Sub-Navigation is now visible on mobile. It is because the navigation element has classes "hidden md:flex" , it is hardcoded in vendor/filament/filament/resources/views/components/page/sub-navigation/tabs.blade.php Is it possible to override this?...
No description

How to modify global search

Hi i would like to modify global search i want when user type something i take user input call mine class and then return the user input. Is this possible. On this discord question i said why i need these.

How to trigger a click event on 'next' button click in Wizard Step form.

I am using Action on table. Inside the Action I am using Wizard Steps. In my first Step using a Livewire component to create table like form. Now by default I have 'Next' in Step 1 to goto in Step 2. I would like to trigger a click event on click of this button Next button. Any idea please help. ```...
No description

Filepond Translations Issue

Hi, is there a way to translate filepond.js validation messages?
No description

Problem when saving a record in a form that contains a table (custom filament Livewire component)

Morning 👋🏽 I have the following case. Case...
Solution:
Ok I fixed the problem like this: - I created a view page for the resource. - The custom filament component (the table view) is only visible in the view page - During edition I have the component hidden -> this makes the form to be stored again....

colorpicker default value set

How to set default value of colorpicker in form?

Format currency

How do you format a field, so that it displays in the format of a currency?
Solution:
Thank you

Filament Multi-Select Not Loading Default Values from Third Table (Not Pivot Table)

Hi all, I'm facing an issue with Filament in Laravel where a multi-select field isn't loading its default values in the edit form. My setup involves saving selected values in a third table, which isn't a traditional pivot table but rather an additional table (CarUsageRecord) related to a Task model. The Problem ...