Filament

F

Filament

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

Join

Testing repeater if field exists

I'm testing the form of an action of a custom page and need to check if all fields are present. The form has an repeater component. How can I check the existence of the fields in the repeater component? For the normal fields the test works fine, but I can't test for the repeater fields. Here is the test: ```php #[Test] public function it_shows_full_group_form_for_super_admin() {...

Filament Panels (Componenet)

Currently upgrading from v3 to v4 and I've encoutered this issue
Unable to locate a class or view for component [filament-panels::resources.relation-managers].
Unable to locate a class or view for component [filament-panels::resources.relation-managers].
...

Filament Shield 4.0 Publishing Issue

Hello, Is it possible to publish Role Resource in 4.0 shield package ? I have been trying to figure that one out, lookng docs and publishable assets but unable to find command to publish resource....

Access current item in RepeatableEntry

Is there something between $record (all the items) and $state (a field of the current item) in RepeatableEntry? I can access another field if I add a hidden entry for it and reference that entry with $get, but maybe there's a better way? 😺 ``` RepeatableEntry::make('items') ->schema([ TextEntry::make('type')...

How to add loading for filament wizard Next Step Button?

Wizard::make([ Step::make('General Information') ->schema(ClientResourceForm::getFields()) ->columns(), Step::make('Address Information')...

Don't show View button on table row

I have the following code, which opens a modal when I click on the row. It also adds the View button on the row, which I don't want as it takes up space and is unnecessary. Is there any way to tell the system not to show the View button? `public function table(Table $table): Table { return $table...
Solution:
```php ->recordActions([ ViewAction::make() ->hiddenLabel() ->icon(null)...

RepeatableEntry Actions Not Working in Filament v4 ❌

Having issues with actions inside RepeatableEntry schemas in Filament v4. The edit and delete actions are completely unresponsive, while the header actions seem to be working perfectly fine. Code structure: ``` RepeatableEntry::make('candidateEducationHistories')...

How to export related students from single university? I see only export by header action.

Hello I have a table universities and students In the university list table actions(view,edit,export students) , I want to export students of each university by export button....

Stumbled on an interesting bug today

A member of the team reported that when trying to create a record, the page becomes unresponsive and does not create the record. I was able to reproduce only by grabbing the exact text they were putting in one of the text fields in the form and it generated the console error: ``` Uncaught (in promise) SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)...
Solution:
It was the WAF blocking the request 🤦‍♂️
No description

How can I add a custom select when using a filter?

I have a filter where the user selects an address. I then sort by closest location, but I can't seem to get the distance to display. When I do this:
$query->addSelect(ST::distanceSphere($coordinates, 'coordinates')->as('distance_to_address'));
$query->addSelect(ST::distanceSphere($coordinates, 'coordinates')->as('distance_to_address'));
It doesn't actually update the query, it still just has "select *" instead of my added select. The query scope I use does work when I use it outside of filament, it just seems like filament is overwriting the custom select....

Code Editor break long lines

I am using the Filament CodeEditor component: ```php CodeEditor::make('content') ->columnSpanFull()...

DateTimePicker(Non Native) Reactive Infinite Bug

``` public static function configure(Schema $schema): Schema { return $schema ->components([...

How do I fix the placement in an ActionGroup inside a table?

I'm using ActionGroup in a table since I’ve got a bunch of actions. It’s fine at the top, but here’s what happens at the bottom [IMAGE ATTACHED]
Solution:
@taqi I hope this helps. The '.flip' is missing in v4, this hack did it for me.
No description

Custom Data in a table - how to set empty state?

The new custom data feature in v4 is fantastic but how do I set an empty state to appear like normal tables if there is no data?

Show table actions on view page instead of edit page.

What I am trying to do: Currently my CreateAction button is only shown on the relationship table when editing the parent record. I want to show this button when viewing the parent record. What I did: I currently only found one solution and that is to add the ->authorize() method on the action....
Solution:
Seems like this is the right solution: ->readOnlyRelationManagersOnResourceViewPagesByDefault(false); https://filamentphp.com/docs/4.x/resources/managing-relationships#read-only-mode...

Why is filamentphp 4 so limiting in forms, modals etc?

Hey all, I’m running into limitations with Filament v4 and wondering if I’m missing something. 2 Examples: – Modal → table in modal → edit → should open a new modal (only footer actions seem to work, which isn’t usable here) - Buttons / actions inside repeaters don’t seem to work (e.g. product in a repeater → open “add photos” modal → see selected photos back in the repeater) ...

Rich editor custom block and spatie media library

I have a richtext editor field, where I am using RichContentCustomBlock. One of these blocks should also use an image upload in the form of spatie media library field: ```php public static function configureEditorAction(Action $action): Action {...

How to test the schema state of a relationship manager that is a simple resource

What I am trying to do: I'm trying to test if the TextInput inside a form of a relation manager has a default value set. What I did: AddressResource is created with this command: php artisan make:filament-resource Address --simple...
Solution:
Apparently you just need to mount the action before calling assertSchemaStateSet:
->mountAction(TestAction::make(CreateAction::class)->table())
->mountAction(TestAction::make(CreateAction::class)->table())
...

Select relationship with max one query

I'm trying to have a select menu with about 10 options queried from a database. Which are searchable for easy selection. However, on each keystroke the searchable queries the database which leads to high loading times. So I want it to only query once. Using options with a pluck() would work if I didn't need the relationship to save my data afterwards. ```php Select::make('labels') ->label('Labels') ->relationship('labels', 'name')...