Filament

F

Filament

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

Join

Tab Badge not updating

I have a tab in ListBlogPosts where i have two tabs with badge that has count. I want the count to be dyanamically updated based on my active filter. Sadly, the count does not update. Probably the code to generate the badge does not run on filter change. Is there a way to achieve it? ```php...

Richeditor is not working(i can not type inside)

Hi everyone this is very confusing error because i do not know when this started happening but happend to me that no matter how much i click on the rich editor, rich editor is not focus i can not type i click on the tollbar but that is all. Down is the picture how does the richeditor looks like. Did anyone happened this what can cause a problem
No description

Deliver notifications in email

Hello, I am wondering if there is any way to extend the Filament Notification class to be able to send notifications in email in a way that is similar to ->toBroadcast($user) that is like ->toEmail($user). It doesn't need to be the most perfect email but my code is mostly based around Filament notifications so something simple to implement across the whole app is required....
Solution:
```php <?php namespace App\Notifications; ...

What's your rule of thumb on when to use `heroicon-o` vs `heroicon-m`?

Currently I have a mix of these throughout my app and I'd like to standardize on when to use which. I'm just wondering what you all do?
Solution:
Your questions was about -o vs -m 😅 I guess it's kind of preference. Smaller icons are better in solid. Larger icons might be too bold in solid

Global setting for TextColumn partially working

Hello, I trying to use the global setting for TextColumn but only partially working. It is working on a resource page, but in a relation manager not working. This is the code what I am using:
TextColumn::configureUsing(function (TextColumn $textColumn): void {
$textColumn->timezone('Europe/Bucharest');
});
TextColumn::configureUsing(function (TextColumn $textColumn): void {
$textColumn->timezone('Europe/Bucharest');
});
...

->description() - is it possible to further style?

Table columns and using the ->description() method (correct term?) for example like this ``` Tables\Columns\TextColumn::make('name') ->label('Filename')...

GetStateUsing - when can it be used? One example that works, one that doesn't

Hi all, GetStateUsing - have found this useful - here is an example of it being used to retrieve the description from an array - and this works beautifully ``` public static function table(Table $table): Table {...

How to edit default input value

Hi everyone i have a case where before i show the data i have to change it is there a some function or somethin can be good for me ->afterStateHydrated is not good solution any other is good

Laravel Octane and Filament

I am running into issues on production where resources are not the same when refreshing a couple of times. For example: I use the filament shield plugin where I can select permissions for users, sometimes no permissions would load and when i refresh a couple of times it would. Is this a common issue?...
Solution:
This indeed was a spatie permissions issue.

Tab not initialize

`public function getTabsDetail() : Tabs { return Tabs::make('Tabs') ->tabs([ Tab::make('Notifications')...
Solution:
sorry, i just figured out that i have to declared the use InteractsWithForms; use InteractsWithInfolists; when using Filament\Infolists\Components...

Problem in modal form

Action::make('import') ->form([ FileUpload::make('upload'), ]) ->action(function (array $data) {...

Unable to login when create new role

Hi everyone, I am using bezhanSalleh/filament-shield package to created a new role. I created new role called "view_data," which only allows viewing data. Then, I created a new user and assigned this "view_data" role to him. However, when he tries to log in, it shows a "403 Forbidden" error. How can I fix this issue? Can anyone help me with this?...
Solution:
The HasPanelShield trait provides an implementation for the canAccessPanel method, determining access based on whether the user possesses the super_admin role or the panel_user role. It also assigns the panel_user role to the user upon creation and removes it upon deletion. Ofcourse the role names can be changed from the plugin's configuration file.
It's not an issue but the intended use case if you read the docs....

Set dependant value of Datepicker in form() Filter

In table filter class, how can I set other Filter form based on other value? In my example, if konfirmasi_hari_ini is checked, then the value of filter ['tanggal']['from'] and ['tanggal']['until'] is set to now() ```php Filter::make('konfirmasi_hari_ini')...

Repeater : Grouping items

Hello guys, Is there a way to hack repeater in order to set groups titles ? let's say we have items table belongs to item_categories table, I want to set the group name as title separator Thanks 🙂...

Builder: block open by default?

Hello, I'm using a simple Builder in my filament admin app. My builder contains 2 blocks : Paragraph or Image, each having multiple inputs. ...
Solution:
Try ```php ->default([ [ ‘type’ => ‘image’, ‘content’ => []], ])...

how can disable days of week?

Hey friends, i need disable a days of week that i don-t have in the array in my table, i try whit this code but is not working, do you have any idea about how can fix this? i have this in my table row availabledays ["Lunes"]...

Repeaters... How to feed them custom data?

So below i have the following code which reports the following display. I cannot use relationships on the "front end" due to how we are using tennants
No description

`->unique()` rule inside relationship instead of whole table

Hey guys, I have this url /{clientSlug}/{productSlug} On ClientResource, I have a ->unique(ignoreRecord: true) on the slug field and this works fine. Now I want to be able to create multiple product with the same productSlug unless they have the same parent (client). I found ->unique(modifyRuleUsing: function (Unique $rule, $record) but I'm not sure how to implement this....
Solution:
I think I got it: ```php Forms\Components\Select::make('client_id') ->relationship('client', 'name') ->required()...