Filament

F

Filament

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

Join

Export Action didn't Export A Defined Column

Im trying to export a table of temporary password into xlsx & csv. The migration and model is pretty simple model ```class TemporaryPassword extends Model {...

Attach BelongsToMany after creating a record in from a table

Sorry, the title is weird but I'm not sure how to summarise it. I have a many-to-many relation something like ```php...

custom page form from resource

hi just want abit of advice i've added the element to my custom page:
<form wire:submit.prevent="submit">
{{ $this->form }}
</form>
<form wire:submit.prevent="submit">
{{ $this->form }}
</form>
...

Display data based on the option selected in select

Hi colleagues. I'm wondering if anyone can help me. I've created a form with a related drop-down menu that loads tutor data....
No description

Render relation manager under condition

Is in filament possible to show relations only under some condition ? I need to show ProductsRelationManager only, if the edited Category isnt parent. Image is just example, what I would like to create....
No description

Not Working LocaleSwitcher if i selected de or en

` ->afterStateUpdated(function (Set $set, ?string $state, Get $get) { $locale = $get('activeLocale') ?? app()->getLocale(); // Get current locale dd($locale); $slug = $get("slug.{$locale}"); ...

Tenancy Cors error

Hi all, I'm using tenancyforlaravel icw filament, and most all is working fine. But now on a ToggleColumn I get the following cors error: - Access to script at 'http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0' from origin 'http://duru.examp.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. - GET http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0 net::ERR_FAILED 200 (OK) - Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://examp.test/js/filament/tables/components/table.js?v=3.3.5.0...

Force select value based on a toggle option

I have a select value with three possible values (0 ,1, 2) ,next to it I've a toggle, when the toggle is true, the select value must be 2. So on my Toggle I'm using ->reactive()->afterStateUpdated( to update the select value, and on my select I'm using disabled(fn ($get) => $get('my_toggle') === true). The problem is that now the select values does not gets submitted, so the value is never updated. Is there a "pretty" way to do it ? As there's no readonly method on Select....
Solution:
ssooo
->disableOptionWhen(fn (string $value, $get): bool => ($get('my_toggle') === true && $value !== '2'))
->disableOptionWhen(fn (string $value, $get): bool => ($get('my_toggle') === true && $value !== '2'))
...

togglebutton group information

hello team, I read the docs, but I still not have the right behaviour I want with filament I created a filament page, with a form filled, and I want to group my items by sort of information In other words, I have an array which contains another array in it, and I would like to split my array into 2 defined groups ``` return $form...

Badge count on relation manager tabs

Hi all, is it possible to get a count of all the records in the relation manager tab badge?
Solution:
in the relation manager ```php public static function getBadge(Model $ownerRecord, string $pageClass): ?string {...
No description

Having to click action button twice for changes to take place

I have this Button and on click I want to change pdf template Actions\Action::make('test_smthng') ->label('Change PDF preview') ->action(fn () => $this->selectedView = 'pdf-templates.layout.pdf-preview-default')...

Add logout navigationItem to sidebar

Hello ! I'm trying to add a navigation item on my sidebar to logout, I made this in my panel : ```->navigationItems([ NavigationItem::make('Déconnexion') ->url('/logout')...

Form in view record

In my Intervention resource, which displays the details of a client's intervention, I want to add a form that allows users to add activities related to this intervention. This form should contain a simple textarea field and be displayed directly on the intervention's view page (which extends ViewRecord). Additionally, the activities that have been added should also be displayed on the same page, below the form. How can I achieve this in Filament and Laravel?...

Create resource for email marketing

I'm almost finished with my SaaS project, and one of the things I'm including is the option to do email marketing. That is, to be able to create email campaigns and send them from a Filament resource. My question is if there is or do you recommend a way to do this, and where I can have an editor or preload a template with pre-made designs... I'm thinking about asking an AI like Claude or ChatGPT to create some templates for me, but I don't know how I could do it so they're editable and can be previewed by the user. Maybe my question is a bit confusing, but finally, any ideas or recommendations would be great. I want this part to be extremely easy for the end user as well, since the first image gives the option to customize or create something like that on the same page. And if I can make this easy for my client, it will be so much better... My idea is to make it as easy as possible for my client. I think I could set up some fixed fields using image, textarea, and text input types, and just change some predefined designs that I could add in the future. I could start with 3 or 4 but offer more designs to my clients later. This way I make my client's life much easier with email marketing....
No description

Combine more than one field in a Filament Resource recordTitleAttribute

Is there a way to call a function to instead reading just an attribute? So instead of protected static ?string $recordTitleAttribute = 'title; Using something like fn ($record) return "{$record->title} / {$record->subtitle}"...
Solution:
just override the getRecordTitleAttribute() method.

How To Add Next Button to the Form Tab

Hello, seeking for help. I want to add a Tab that have next and previus button then only in the second tab will save the data.

Markdown Toolbar Buttons

Are these all the available toolbar buttons for the markdown component, or just the default applied? Hoping for H2 and H3 heading tags. >"You may set the toolbar buttons for the editor using the toolbarButtons() method. The options shown here are the defaults:" ```php...

Trigger state format when reciving new state from afterStateUpdated with $set from another field?

If you have a field like this: `TextInput::make('price_to') ->live() ->label('Price To')...
Solution:
You could just extract the formatter to an str macro or helper function then you don’t have to repeat it. Also, iirc, formatStateUsing() only runs during the form initialization so it doesn’t run on updates through get / set which manipulates the livewire data directly....

I need help with bulkaction checkbox

``` class Storage extends Page implements HasForms, HasTable { public function form(Form $form): Form...

Livewire Starter Kit with Filament form and table builder package

Can we use Livewire Starter Kit and Filament packages together? I've tried a few times but couldn't succeed. Has anyone tried and succeeded?