Filament

F

Filament

A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire

Join

Problem implementing stancl/tenancy with Filament 4

I’ve been trying for days but I can’t get multitenancy to work. I’ve installed Stancl, and I’m at the point where I can create tenants from the backend with a dedicated database and admin user. But I have a login issue: If I visit a URL like tenant1.mysite.ddev.site/login or tenant2.mysite.ddev.site (these are two existing tenants), I see the login screen, but when I try to log in I get:...

Tailwind Colour Palette Not working

So in my blade I have the classes accordingly, for example `text-violet-500'. Which is an available tailwind colour. I've added my view in the tailwind.config.js. And I've tried registering the colour in the ->colors array inside the AdminPanelProvider. But I just cant get it to work I am running npm run build on each change correctly also....
Solution:
I've have had to add to the safelist key ```js safelist: [ {...

filamentphp Maximum execution time and Allowed memory size issue.

I recently installed FilamentPHP and created just three resources for the admin panel. After that, I added the Filament Spatie Media Library plugin. Once I uploaded a file using the media library, I started getting errors related to maximum execution time and allowed memory size. Now the admin panel shows a 500 Internal Server Error and doesn’t load at all. I’ve already increased both the memory limit and execution time in PHP settings, but the admin panel still isn’t working....
Solution:
Please upgrade Filament to the latest version if it isn't already.

Widget Table : display records count

Hello, on my dashboard, I display a Table widget. I'd like the number of entries to be displayed. Like in a classic table, for example "Showing X of X results". I can't find a way to do this Thanks for your help...

Submit a form with a header Action on a custom page

Is it possible to use a headerAction to submit a form on a custom page? I want to move the submit action to the top right of the page in the header. but I don't know what the trick is to then submit the form with the button. I have tried JS to submit the form but, ...
Solution:
Ok try this ```php protected function getHeaderActions(): array { return [...

Livewire Fileupload (error 401)

I have a filament app that has custom page and uses a livewire component. it is an upload component (xlsx file). upon uploading I've encountered a 401 error. Please see attached images
Solution:
i added this
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*');
})
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: '*');
})
...
No description

custom dashboard page header heading | add auth user name into the heading of a page

im looking to turn this:
protected ?string $heading = 'Welcome';
protected ?string $heading = 'Welcome';
into something like this:...
Solution:
Hi, you have the getHeading() function on Dashboard too :```php class Dashboard extends \Filament\Pages\Dashboard { public function getHeading(): string | Htmlable {...

how to hide other field in select table filter according to another filter

Filter::make('within_h') ->label('H-Tempo') ->schema(function ($livewire) { return [ \Filament\Forms\Components\Select::make('range')...

View page with editable relations

I now have custom view pages for non admins, but I need to still be able to perform edit actions on the relational panels below the record, is there a way to tell filament that?

Unnecessary space

Can this space marked in red be removed without having to use a theme?
No description

Toggle fieldsets visibility, but also save hidden data.

My form has a selector with many 'providers'. When selecting a provider, inputs relating to that particular provider are shown. Problem is that I want user to be able to switch between providers, without losing settings for other providers. What is the most straight-forward way to accomplish this? Simply showing/hiding fieldset doesn't work, because data for hidden fields is not saved....

Exceptions from Model

Hi, how are you handling when you submit a Filament form, and the Model has a saving function that blocks the saving?? For example, I trigger a ValidationException in the saving function (Model), and Filament doesn't show any alert or message...

Error in search for translatble fields

For PostgreSQL in function applySearchConstraintToQuery() $column look`s like "name->>'en' ", but in lust update of flilament in function generate_search_column_expression() column need to be "name->en". Search in translatble fields now has error...
No description

dynamically hiding actions - caching issue??

Hi guys, I have a permission service which allows admins to edit certain models. I return an array of actions if canAdmin($modelClass) is true, and an empty array if false. So it seems to work and the buttons have disappeared, but upon switching back to admin, the buttons dont reappear, and indeed, upon reverting my code back to the resource with hard coded buttons still doesn't bring them back! Is there some sort of caching issue? because i was sure reverting my code would work :-p
Solution:
I guess you should use ->visible()/->hidden() on the Action instead
No description

Filament notification 500 error

I am working with Filament v3 and Laravel v12. Whenever a Filament notification is created, it throws 500 error and stop the project. Even if I try to run the project again, it will still throw the 500 error. Only after I clear the sessions table or generate a new app_key, the project run again. This happens when I submit any form and filament try to create "Successfully" notification or when I manually try to create filament notification "Notification:make()". Below are the things that I tried but didn't work: - changing SESSION_DRIVER to 'file'....
Solution:
Update to the latest version and try again

custom page with multy isolated components notification dont works

custom page with multy isolated components notification dont works if same time got notifications i cannot see it ro fast re-rendeering notification dom
#[Lazy] #[Isolate] class OltClient extends Component implements HasForms, HasTable...

Is there a way to cache table data?

My client likes to load one of our tables with every record visible, which is thousands of rows. I suggested not doing this but it seems like its a must have. Can we cache table data at all? I can't seem to find a way to do so.

$view must not be accessed before initialization

What I am trying to do: To go to the resource that is located inside a cluster. There I have custom index page for route('/'). What I did: In every page Filament\Resources\Pages\Page inside that cluster for that resource I have this with corresponding blade file:...
Solution:
Strangely, but in my case the error was that, canAccess() was not provided. Therefore, it could not access that resource at all. After providing this: ```php public static function canAccess(): bool {...

Table widget custom filter does not update table result

I've been asked by my client to have an overview table with the most popular coupons on our site through a list with filters. Therefore i proceeded to create the following table widget ```php class MostVisitedCouponsTableWidget extends BaseWidget...

Trick to have element be alone in a 2 column row?

Hi, I have a 2 columns setup in a Form. I want 1 element to take 1 column, then nothing next to it, then on the following row, the remaining elements. ...
Solution:
better example ```php ->schema([ Group::make() ->columns()...