Filament

F

Filament

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

Join

v4: set TextEntry state from handleRecordCreation

I want to display an error message in a TextEntry when record creation halts. What should I try to do that? There is an example here for sending a Notification but I want to display the message above the submit button so its easier to notice https://filamentphp.com/docs/4.x/resources/creating-records#halting-the-creation-process...
Solution:
Schema is defined static but you can access the regular properties like this ->state(fn ($livewire) => $livewire->error)...

V4 UI Documentation Issue ?

Hi, this is kinda out of scope I think for this channel since we are not in V4 but still it cought my eye.. Do you think this is a bug or no? To be more precise when navigation item has children should icon rotate by 90 deg? ...
No description

Navigation order - mixing groups and items

I know a variety of similar questions have been asked and Ive read them but I think Im trying the selected answer and not getting the suggested response. Im trying to make a custom menu so that i have 3 navigation items going to urls, then a group (My Account) and then 2 further Navigation items to log out and to go back to a previous website. A cut down version of my requirements is basically like this ``` ->navigation(function (NavigationBuilder $builder): NavigationBuilder { return $builder->item( NavigationItem::make('Dashboard')...
Solution:
one off items are put into their own 'group' and prepended to the navigation collection, but you should be able to achieve what you want with this (but the spacing might be weird, but should be adjustable with some custom CSS): ```php ->navigation(function (NavigationBuilder $builder): NavigationBuilder { return $builder...

How to override relationship query "and not exists"

I'm working on a project where I've created 3 "aliases" of a model for logical reasons. For an example, say I've created a "car" model. I have also created "race car", "passenger car" and "sports car" models. All of these models come from the same "car" table. The "aliased" models are designed so they can be matched against one-to-many junction tables (so for example, a race car would have entries in the "races" table, so for me to get a list of any race card, I just need to query against the "races" table. Now the issue:...

Attach Action is not updating the UI

Inside a ViewPage I have a custom Infolist to display data of the model. Also, I created a few custom Actions to create/edit/update data from the record or related records. But, the problem that I'm having is that inside the infolist I have a Tab for products and another for tasks, with a repeater to show the related record. The products is a BelongsToMany relationship and Tasks is a morphMany. Currently I have an action to create a Task and one to attach a Product, but whenever I attach a new products the infolist UI doesnt update (the new attached product is not shown in the repeater), i have to reload the page manually. Can anyone help me solve it, or understand why its happening? ```php // Create task action...

Live select update issue

Hey! In one of the use cases, I have two multi select fields carBrands and carModels ```php Forms\Components\Select::make('carBrands')...

How does the filament select table work?

The filament field is a regular blade component, not a livewire component. Why is there pagination, etc.?

Reflect Table Interactions in Form State

How can I catch checkbox changes or modify the array data? I'm using a custom Table component inside a form and want to reflect any checkbox updates directly into the component's $data property. ```php...

create another

what i need help is bassilcy how to modify the search query for relationship select i need where name is like search or where company name is like search but am having so many probelms somehow fillament is injecting a new query ```sql...

security. is this code enough to stop someone create/edit data via postman?

class UserResource extends Resource { protected static ?string $model = User::class; protected static ?string $navigationIcon = 'heroicon-o-user-group';...

How to test Filament widgets?

I am a bit lost right now. I try to test a Filament (v3) widget via Pest/PhpUnit, but can't just get it to work. The stats widget itself is nothing special, the only code is in the getStats() method which returns a few Stat components. The getStats() method is protected by default, so I would need a reflection class to access that data, which feels wrong. My second idea was to just render the HTML, but that leads to an error. ...
Solution:
I think they are livewire components. Did you try testing them via the Livewire helper?

v4 testing RichEditor inside form

Is there a simpler way of populating the editor inside fillForm? Without the array you get error from the beforeStateDehydrated
TypeError: Filament\Forms\Components\RichEditor::{closure:Filament\Forms\Components\RichEditor::setUp():303}(): Argument #2 ($rawState) must be of type ?array, string given
...

Help: Filter Reset Action

I’m building a custom Filament page where I’m not using a table, but I added a FilterAction to handle filtering. It’s working, but I’m struggling to add a reset button to clear the filters from the modal form. ```php public function filterAction() { return FilterAction::make('filter')...
Solution:
Suer, @Dennis Koch , For now, ```php ->extraModalFooterActions(function () {...

How do you add a tool-tip to an anchor tag in custom view?

I have a custom page and added a tooltip but it wasn't able to show. <a href="#" class="d-inline-block p-2 disabled" data-toggle="tooltip" title="Please remove all settings to delete section"><i class="fas fa-trash opacity-50"></i></a>...

loadedOnRequest() not loading assets on request

I register the followinf assets in my service provider: ```php FilamentAsset::register([ Js::make('local-player-script', DIR . '/../../resources/js/local-player.js')->loadedOnRequest(), Js::make('radio-player-script', DIR . '/../../resources/js/radio-player.js')->loadedOnRequest(),...

Deleted_at from and until with TrashedFilter

Hey! I was wondering if anyone have done this before or have had this issue but any help will be much appreciate it! I have a resource that has a TrashedFilter filter. I'm trying to implement another filter that will filter results by deleted_at from and deleted_at until. ...
Solution:
@Dennis Koch thank you very much! That did gave me an idea! For anyone facing this issue or anything similar you can get a filters value using: $livewire->getTableFilterState($filterName)...

Can we use table filament in custom field?

I read docs work in livewire component, custom field not livewire component humm. https://filamentphp.com/docs/4.x/components/table...

Chain table headerActions

I have a headerAction in a table with two fields. I want to call a modal's method from the submit button of the first action, and paint the result as an Infolist in other action's modal with RepeatableEntries. Until now, I've never achieved to show the second modal. What am I doing wrong? 🤔...

V4 Save form in livewire component

Hi, working on custom plugin for Filamentphp V4 I've worked without problem in the past with the V3 but this time i'm making a plugin that add a register/login form outside the panels The plugin is registerd in the AdminPanel. Livewire component...

Plugin Upgrade script

Is there a plugin upgrade script, or do I have to do it manually? (v3 -> v4)
Solution:
There is no update script for plugins