Filament

F

Filament

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

Join

Panel Authorization

Hi! I have a "Orders" resource, and a "My Orders" resource. How should I define policies? since a user should always viewAny order when enters MyordersResource... and don't have access to viewAny() when entering "Orders" ? Only admins can see all Orders. Both resources use the same model. Thanks!...

filament()->getTenant() null in bootUsing

When dd'ing filament()->getTenant() in the panels bootUsing method it returns null no matter where I navigate to

Attach action error in RelationManager

I am getting below error during Select search while performing Attach action in header of Relationship manager.
Call to undefined method App\Models\Setting\BusinessCategory::businessCategories()
Call to undefined method App\Models\Setting\BusinessCategory::businessCategories()
I have BusinessCategory model with N:N relationship with itself. My model has parents() and children() methods. Currently it is only two level. And I using using simple Attach action in the Header.

How to use the resources outside of panel

I'm using filament table on a custom Livewire page, which is working just as expected. However, i found the finished class is just really long and messy. Especially for the action part, for each table, i need to set up actions for view, create, edit, and delete. Each action will then contain more code such as forms, hooks, notifications, etc... Putting everything inside one function makes the code very hard to read and manage. ```public function table(Table $table): Table...

The huge form is too slow

I have a form that has 200+ fields. When saving I get the timeout error Maximum execution time of 30 seconds exceeded Any ideas on how to speed this up? ...
No description

Does configureUsing work on Filament\Panel?

I'm using a logo on my panel which works fine if I set it in the panel() method of the PanelProvider. But since i'm going to want the same on every panel, I'm trying to set them in a global Service Provider. To keep things separate, I created a new provider and added this: ```php public function boot(): void {...
Solution:
Probably the AppServiceProvider is already too late because the panel is configured in a ServiceProvider too. Can you try this in register() method?

Help with Filament/Livewire setup

Hi all, I'm trying to follow this guide: https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component The table is displaying just fine on my webpage, but no sorting logic is working when I click. In my browser console, I'm seeing the following 404s: `Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error...
Solution:
Figured it out. Was a simple error where I didn't properly use all of the CLI commands, so some of the files were missing after I started over a few times. Thanks both 🙂
No description

programmatically filling in multiple Repeater entries on create form

Hey, I have a repeater on "CreateInvoice" page that I want to populate with "expected invoicelines". I have my repeater setup in "CreateInvoice" page getSteps() method with a relationship to InvoiceLine, but I want to pre-populate the repeater entries with multiple entries that don't exist yet as InvoiceLine. Is there a method that I can manually set multiple repeater rows and their values? ...
Solution:
nvm its $repeater->default([ ['field' => 'value'] ])...
No description

Table Widget: hide the title / header

How can I hide the title / header of a table widget? Cheers, Tee...
Solution:
->heading(null) if you are using a table widget..
No description

Can't create custom page with multiple forms

I'm creating a custom page and so far it has been working correctly, but now I found a problem that doesn't make any sense to me. This custom page has two forms in it. Following the documentation about adding forms to livewire components: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#using-multiple-forms I implemented the HasForms interface and used the InteractsWithForms on the custom page class...

Hide Resources from Panel

Hi I am sure this is simple but cannot see how this is achieved. Say I have a resource "pets" - I get a number of php dfiles generated for this and a link is added to the admin panel - this all happens automatically. I'm doing POC stuff and I'd like to keep what I have (code for reference) but not have the resources cluttering up my admin panel - what's the method (short of deleting the files) to remove them from the view of the user? I guess one option would be to create a new Laravel app 🙂 or to create a new admin panel - but just wanted to know if there is a simple way to achieve the hiding of resources that you don't actually want to see? thanks...

Reusing a Page

I have created a custom page that I've been trying to make reusable. So based on one of the tables in my database, I want to have multiples of that page show up in the navigation for each entry for a particular user. I've had a look through the documentation quite thoroughly and there doesn't seem to be anything about being able to reuse the same custom page multiple times. Wondering if anyone had any ideas on how to get this to work?...
Solution:
getNavigationItems() sounds like a good solutions to this

Load relationship on widget

I create a ManageRelatedRecord and add widget on it. While user save product card then it add the row on table below This is my widget ```php class AddProductCardWidget extends Widget implements HasForms...

Share validation rules with api resource controllers

What's the best way to reuse validation rules between my api resource controller and Filament? I've tried to re-use the validation rules from custom FormRequest: ```php public static function form(Form $form): Form {...

Chart to Blade Issue

I'm trying to insert the chart from filament chart to blade but it displays nothing and css is not working
Solution:
if you are using this outside the panel, you should check this section https://filamentphp.com/docs/3.x/widgets/installation#existing-laravel-projects...
No description

Empty field on condition

I have the following schema: ```php Toggle::make('notify_unlock') ->label(__('form.labels.notifyUnlock')) ->live()...
Solution:
```php Toggle::make('notify_unlock') ->label(__('form.labels.notifyUnlock')) ->live() ->columnSpan(1)...

Read/Write Databases

Is there any configuration available for separate read/write database instances? Currently my list in my resource is empty since I added the configuration for separate read/write database hosts...

Multiple resource

Hey! I wondering, is it possible to handle multiple resources in one resource page without any plus relation tables? I mean if I have and Event resource, and an EvenTime resource, is it possible to fill all of the fields in on page?...

Excel Exporter for Laravel Table on Livewire Component

I have a header action that exports to an excel file. I have make everything according to the docs on how to set up the exporter. My table is on a livewire component though. It shows me that the proccess has started as the notification but it does not show me the notification when it is ready. I don't want to have this notification in the admin panel but on the livewire component that i have in a view. I have added in the app.blade.php
@livewire('notifications')
@livewire('notifications')
...

on table builder select parent child

Hi I have a select with multiple and I have a parent child table for categories, can i set the parent categories to be a label or heading and the children are selectable? or if not possible can i have a section with heading per category? like the image below, thanks
No description