Filament

F

Filament

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

Join

Upgrading to Filament v4 – Alternative for TableRepeater emptyLabel()?

Hello, I’m currently upgrading my project to FilamentPHP v4 and I’ve been using TableRepeater by Adam Weston in my codebase. In Adam’s version, there was support for an emptyLabel() (used to set a value for the empty state). While migrating, I’m not sure what’s the best way to handle that part....
Solution:
yeah would accept a PR that adds the same methods as the table's empty state

How to transform a normal Wizard into a Vertical Wizard?

I need to transform the default Filament wizard from horizontal to vertical. How can I do that? What exactly do I need to edit?
No description

Sortable and Searchable in pivot column not working

I have a many-to-many relationship between Company and Person. The pivot table and model (CompanyPerson) has an office column that refers to another model. The data displays correctly in the table when accessing "pivot.office.name", but the ->searchable() and ->sortable() methods don’t work. What is the best way to fix this?...

Filament v4: Adding extra fields on ViewRecord page

Hi all, I have a use case where I have a ViewRecord page which shows data in a infolist. But I want to add some extra fields by calling an api. I prefer to override the method mutateFormDataBeforeFill https://filamentphp.com/docs/4.x/resources/viewing-records#customizing-data-before-filling-the-form but looks like it is never called. How can I add new fields to the infolist. ```php /** * @param array<string, mixed> $data...

Update create action labels globally

Is there any global way to update all of the CreateAction buttons labels to use "Create" instead of "New", or would I need to customize that for every resource? I have many many many resource items and am trying to avoid manually changing them all but when them to consistently say "Create..." instead of "New..." because one of my resources is "News" and "New News" looks ridiculous lol...

Is it possible to make relationship tabs vertical?

I have a MemberResource with 27 relation managers. By default these are tabs shown at the top of the page that can be scrolled left and right since they overflow beyond the screen width. However our internal team work with mice that don't have horizontal scroll 😂, so I'd like to make the tabs vertical down the right of the page. I can see that ->vertical() exists when you are building tabs from scratch, but is it possible to implement on these relationship tabs? https://filamentphp.com/docs/4.x/schemas/tabs...

Compact layout setting?

Is there a global setting that changes the margin/padding of items to a more 'compact' theme? If so, how do I set it?
Solution:
You can explain that "Filament doesn’t have a single global “compact mode” setting", but you can "globally adjust spacing (padding/margin) using custom themes and CSS utilities".

Trying to test action on specific tab

I have multiple Tab in my ViewRecord page and i want to test if an action is exists on this specific tab. How can i set the active tab using the livewire() function? ```php /* How can i set which tab is active ? */ livewire(ViewOpportunite::class, ['record' => $opportunite->id])...

How to get the live order of repeater item

Hello everyone I wonder if there is a way to get the repeater item order position inside a repeater field on reorder with buttons or drag-and-drop, regardless of the database order column, I have a repeater field ...
Solution:
solution is
$state = $get('data.steps', true);
$order = array_keys($state);
$state = $get('data.steps', true);
$order = array_keys($state);
`...

Accessing Selected Records on Page without BulkActions

I have a custom page with a table that allows users to select records. The issue is that I can’t find a way to access the selected records directly from my page. When I use BulkActions, it works fine, but that’s not the behavior I want. Here’s what I’m trying to achieve:...
Solution:
Ok i kinda found the solution that i was looking for. You can give the table a property where the selected records should be entangled on. return $table...

Making an empty RichEditor field save as null

Has anyone figured out how to make an empty RichEditor field save as null in the database? To avoid empties saving as
{"type": "doc", "content": [{"type": "paragraph", "content": []}]}
{"type": "doc", "content": [{"type": "paragraph", "content": []}]}
as those render into <p></p> so its a bit weird to check whether the value exists....

Call to a member function getRelated() on null

TextColumn::make('parentMenuItem.name') ->label('Bovenliggende item') ->placeholder('-') ->sortable(), ...

Form Select Problem

i have this problem after upgrading to filament v4, select form in a modal
No description

Prevented dependency injection of Models (non existent?)

What was the reason for this change: https://github.com/filamentphp/filament/blame/4.x/packages/support/src/Concerns/EvaluatesClosures.php#L85 @ralphjsmit One can restore this by binding all the models, but this goes against Laravel DI since Models can be injected without issues. A clear commit agains this. I'd like to know the reasons behind this. Thank you....
Solution:
In Filament V3 it introduced that you can now alias the injected record to another parameter name instead of $record. For example, you could just do Post $post instead of Post $record. Whilst this was convenient, there are quite often situations where you think there should be a record, but there actually is not (e.g. in complex forms with relationships etc). In that case, returning Post $record would fail on that the argument definition does not allow null, prompting a change to ?Post $record. However, without the above change you linked, the Post $post would still return a Post model, but then an empty one that does not exist at all created by Laravel dependency injection. This causes then weird bugs in your code later one if you expect $post to be the current $record and it turns out to be just an empty unsaved model. Therefore, if the requested parameter is an Eloquent parameter that is not of the current record/model, this line has been added to prevent such unwanted empty model resolutions. See also here: https://github.com/filamentphp/filament/pull/15160...

RichEditor - TipTap - Custom Block for embedding HTML

Hi all, im trying to have a custom block that allows you to paste any html block like iframes or script in order to be embedable in a CMS like environment. I managed to do that just fine. However when i render the html as per the documentation the any data-* attributes are not rendered. Same thing for <script> tags the database has the embedable html just fine. When i dd() i also get it just fine. The problem appears when i try to render it using {!! $content !!} Any help is greatly appreciated! Thanks!...

has something changed Filament v3.3.37?

I'm using Forge, and it has updated filament files, and now a basic boolean always returns true. with a check and icon Tables\Columns\IconColumn::make('is_published') ->boolean(), ...

File uploads throw a 401

We're using Coder.com for our development environments, so they're in the cloud and all the domains have https. This works great for our normal Laravel and Livewire builds, but running into some issues with file uploads now that we're trying out Filament. The APP_URL and the ASSET_URL both point to the https:// version of the URL, and we have this in our AppServiceProvider.php: ``` URL::forceScheme("https");...

Problem with $getId in filament-schema grid component

I’m currently upgrading a custom plugin from Filament v3 → v4, and I ran into a problem when updating the Blade views. In v3, the custom component for Infolists used <x-filament::grid>, but since that no longer exists in v4 (as far as I know), I replaced it with <x-filament-schemas::grid>. After that change, I started getting this error inside the custom RepeatableEntry view:...

How to disable the policy behaviour on the filament resource?

How to disable the policy behaviour on the filament resource? I do not want the policy constraints to be applied on the filament resource itself.