Filament

F

Filament

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

Join

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...

is spa() broken on filament 4?

I'm getting Uncaught TypeError: can't access property "noConflict", jQuery is undefined and Uncaught SyntaxError: redeclaration of const loadDarkMode, resulting of not being able to open modals or switching the theme

Using colours in a blade file

I'm trying to use the bg-green-300 colour in my blade file. ```<div class="flex items-center justify-center"> <span class="text-sm text-gray-500 mr-1">{{ $day }}</span> <div @class([...

TipTap RichEditor: "flatten" or navigate tree for text validation

When implementing a custom validation rule for a RichEditor with a signature like fn(string $attribute, $value, Closure $fail), under Filament v3 with the Trix editor, the $value contains a string representation of the editor's content; with Filament v4 (TipTap), it's a tree structure with nodes for text, images, paragraphs, and so on. Is there a way to restore the v3 functionality, where the validation rule can access the entire contents as a string? If not, can anyone point me towards documentation of the tree structure used by TipTap so I can implement logic correctly examine each text node?...

V4 Money Format TextInput?

I've noticed in V4, the existing code only renders values without decmials. For example: ```php TextInput::make('total_lump_sums') ->label('Total Lump Sums')...
No description

refresh select filter that uses an attribute

I have a SelectFilter which filters upon status as follows: ``` SelectFilter::make('status') ->label('Status') ->options([...
Solution:
maybe you can inject array $data? You can also use custom filter forms...

Is it possible to give a custom Param to the Delete Modal?

Hey guys, i wanted to give a custom Param to the delete Modal, so it does not show my ID. Is that possible? I'm using V 3.3.34 ...
No description

Filament4 'Adding “anonymous” actions to a form without attaching them to a component'

Hello, I have just updatd my project to v4 and one thing has stopped working , which is 'anonymous' in my form schema. The following error is produced when i click the action button Unable to call component method. Public method [mountAction] not found on component...
Solution:
OK, the fix was... adding HasActions and InteractsWithActions trait to my livewire class

Table expandable content creating whitespace

Hi, I'm trying to create some expandable content. However the upper row, is not not taking the full available space anymore, and I have no Idea how to fix it. ```php ->columns([ Split::make([ Tables\Columns\TextColumn::make('account_ref')->label(__('Account Ref')),...
No description