Filament

F

Filament

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

Join

RBAC in Multi Tenant system

Hi Everyone, I'm creating an Multi Tenant system and i want to implement RBAC - can you please help me to suggest what would be the best way to implement this - If you have any working example or a link to a github repo please help to share. Thanks...

Parent resources with nav

I understand that a resource can have a parent resource set, but am trying to get some behaviour and not sure if it's easily possible after digging a bit. Let's say we have an article that belongs to a category. Current behaviour...

EMERGENCY - before, using, and mutateRecordDataUsing doesn't work for EditAction

This is not working for a client that needs this done tomorrow. These methods work on the DeleteAction but not edit. ``` Tables\Actions\EditAction::make() ->mutateRecordDataUsing(function (array $data): array {...

Repeater limitation

I'm having an issue while adding a new feature to the repeater. I want to limit the delete functionality, since I don't need to delete the first repeater item but I do need to delete the others. I tried setting it up with deletable as mentioned in the documentation, but I couldn't achieve the desired result, because it takes the repeater in a general way This is my code: ``` Repeater::make('members')...
No description

V4 Layout help

I have the below code for a filament v4 layout, and I have attached the result for this layout in the screenshot. How can I extend sections so that the information section takes 4 columns and the image section takes 2 columns? Thanks for the help in advance.
Solution:
Flex doesn't support columns like that. Use a Grid instead ```php Grid::make(3) ->schema([...

Select with enum options bug in v4

I had a custom select extending Filament’s select, mainly to load enum options and set a default label (used repeatedly in the app). There’s also a cast so values are saved in the DB as the ordered days of the week. This worked fine in v3, but after upgrading I’m facing a bug: when editing a record, the already-selected days still appear as selectable options. If I pick them again, they duplicate and trigger a validation error on save. I suspect this might be related to my cast, but I’m not sure what changed. I attached the code...
No description

Condensed tables

I was working on a way to make more condensed tables because I have some 800 row tables (I know!). I found that adding this macro to my provider: ```Table::macro('condensed', function (string $class = 'fi-table-condensed'): Table { /** @var Table $this */...

Filament Table Outside of Panel

I am looking for an example of how to use a filament table outside of a panel. I have followed the example in the v4 docs, but the page I get is not formatted correctly. Looks like it is missing CSS or the JS to make it work.
Solution:
I think I figured out what what going on. The docs don't clearly state (in this contect) that you need to add @filamentstyles and @filamentjs

Add modal actions in panel header

I wanna add a dropdown to the panel header next to the user menu and then use the regular filament Actions (inside an ActionGroup). I know, that this is something similar to awcodes/filament-quick-create, but I need way more customization options. I could get the dropdown/ActionGroup already working: ```php...

CreateAction show duplicate notifications. How to disable default?

CreateAction::make() ->label('Add New') ->modalHeading('Add New') ->modalSubmitActionLabel('Save') ->modalWidth('6xl')...

RichEditor in v4 not working!

Hi, I have a RichEditor inside a modal from that is fired with an action. `Action::make('envia_factura') ->icon('heroicon-m-envelope') ->schema([...

Forbidden on temporaryUrl

Hello, In production, I am unable to display previews of images stored as private. The generated URL returns a 403 forbidden error. ...

group table rows by morph column

Hi, i have a price lines table with a parent morph table. A price line can be added to a Order or TransportOrder. I would like to group the table by the unique combination of parent_type and parent_id but i can't get it to work... I have tried modifying query and then calling the default group on the column with parent_unique: ```php...
Solution:
You need both the titleFromRecord AND the groupQueryUsing. This does work. made an attribute on price line and now it groups correct. ```php Group::make('parent_id') ->label('Parent')...

Capture Image from Webcam or Mobile Camera

Hey everyone, I’m looking to implement a feature in Laravel filamentphp v4 that allows capturing images directly from a webcam or mobile camera. Has anyone already implemented this functionality, or can point me in the right direction?...

File upload in a wizard step?

Is it possible to use FileUpload in a Wizard step, read the file, then use the data in a subsequent step? For example upload a csv, then review the data in the next step. I tried to use afterValidation but cannot figure out how to find the uploaded file's path. But I'm not sure if this idea is possible in the first place. 🤔 https://filamentphp.com/docs/4.x/schemas/wizards#step-lifecycle-hooks...
Solution:
$get might work here 😺 now onto figuring out how I can display error messages from Halt to the user, and setting the state on the next step

Authorization issue – inability to override policies in favor of can* methods in the resource

In Filament v3, I could control permissions in the panel using methods such as canView, canEdit, canDelete, etc. in the resource, regardless of whether a Laravel policy was registered for the model. This allowed me to have policies only for the purposes of, for example, GraphQL, and use my own permission logic in the Filament panel. In Filament v4, if a policy is registered for a model, Filament always uses that policy for authorization (via the get_authorization_response function), ignoring the logic contained in the canView, canEdit, etc. methods in the resource. This means that I can no longer independently control permissions in the Filament panel if a policy exists (e.g., for API/GraphQL purposes). Expected behavior...

How to integrate Laravel Policy in filament v4?

I integrate policy in the v4 like in v3 but glad to see not shown in the menu bar but if no policy it's shown.. is policy still used in v4? this is my sample policy ```<?php...
Solution:
Ahh the problem is I forgot to cast the role.. thanks anyways

Delete method inside model policy not working after editing

I tried to disable/hide the delete function when a customer has any comments. It works normally. However, after updating the customer, the delete button appears, which shouldn't be there. Example Code: ```php // app\Policies\Shop\CustomerPolicy.php...
Solution:
I found a workaround for this, inside the delete method policy I added this code: ```php public function delete(User $user, Customer $customer): bool { if ($customer->comments_exists ?? $customer->comments()->exists()) {...

Hide empty tables

When using relationship managers is there a way to make the table not render if there are no records. Thanks, Damien....
Solution:
like Dennis said, this doesn't make sense if you are using header actions to create or attach a record. Anyway, if you want to hide it, I think you can use getRelationManagers in your Edit or View page: ```php...

Help wanted: Upgrade to Filament v4 – mention functionality

n Filament v3, I used the RichEditor’s id attribute to append mentions dynamically. But in v4, the RichEditor no longer provides an id, which makes it tricky to target the editor for custom mention behavior. https://github.com/AsmitNepali/filament-mention/issues/25...