Filament

F

Filament

Filament is a collection of beautiful full-stack components for Laravel.You can get help using it on our Discord.

Join

Disabled class not working ON INPUTS

Hello, I'm experiencing an issue with Filament 3 in Laravel. I'm trying to set the cursor-not-allowed class when the user submits the form, but instead of the disabled class being applied, the readonly class is being applied. When inspecting the element with the fi-input class, I found that the disabled: classes are present....
No description

Services and filament tables livewire component

Hi I have a service that has a load of options, I've queried the options in a select filter, but I am getting: An attempt was made to evaluate a closure for [Filament\Tables\Filters\SelectFilter], but [$value] was unresolvable. Do I need to do something else as it's a livewire component? I have more price options but hit limit of discord Thanks ```...

Question regarding docs / security: "This is not an issue with mass assignment."

I have a question regarding the security documentation page: https://filamentphp.com/docs/3.x/panels/resources/security
While attributes may be visible in JavaScript, only those with a form field are actually editable by the user. This is not an issue with mass assignment.
While attributes may be visible in JavaScript, only those with a form field are actually editable by the user. This is not an issue with mass assignment.
I understand the first part (all attributes are visible, but cannot be modified by malicious users). But what does "This is not an issue with mass assignment." mean in this context?...

Column sortable strange behavior

I've got a simple table, defaultSort by name, but when I click the column sometimes does not sort... and sorts inverse order... strange..

Setting repeater values from action

related: https://discordapp.com/channels/883083792112300104/1270435674390269992/1270435674390269992 I was just wondering how to hydrate multiple repeater entries from an action. I have tried using ->default([ [], [], ]) but it only fills it on page load and not after selecting something on a live input, I need it to be dynamic. Anyone have an idea?...
Solution:
live() and afterStateUpdated() ?

how to use SaaS with filament and multiple databases ?

I have a SaaS API and now I'm implementing filament for the front end part. I don't have any experience with filament and I'm having some trouble at this point and I'm trying to tell you my problem I have a master database wich is default (in .env) and when user submit the login form on filament I get this credentials and find the corresponding database and reconnect it. To make this possible I've override the authenticate function from filament. My excpectation will be from this point everything should work like single database like eloquent queries until next login. ...

auth()->user() is null after login

Simply this....auth()->user() is null after login. Why?

Customizing update process globally

Hi, I have a CustomerResource. In my EditCustomer class I added handleRecordUpdate function. In another resource I use a Select field to select a customer. In the field I added an editOptionForm. Unfortunately when I update the customer via the edit modal my handleRecordUpdate function is not being executed....
Solution:

Re-enter password when switching panels?

I have different panels, some have more sensitive information than others. I want that if user switch to their personal information panel that they re enter a password or a personal code to gain access. How can you implement something like that? Also when they leave the panel the β€œspecial privileges β€œ should expire immediately. I first thought by setting a special setting and checking for it in a middleware but maybe there is a better solution?...

Wizard cancel button not working

Cancel button on wizard takes you to the top of the page on the first click and then actually cancels on the second - is there a way to change the functionality of this button?
Solution:
this was caused by using persistStepInQueryString - it was adding the index to the url rather than going back a page

Livewire components that implements HasForms can have multiple forms ?

How I can have multiple forms in a custom Livewire component that implements HasForms ? This Is my component and in my view I use {{ $this->form }} to render the form. I need a form for FirstModel AND SecondModel. Thanks you. Filament is awesome btw ! ```php <?php...
Solution:

How can I get started with a JS field?

I want to create my own filament field (Slider) which is based on JS nouislider This is currently an Issue on github for filament 4.1. I want to get a jumpstart on this, and even if it doesnt get merged, at least I learned something new πŸ˜… The problem is I have NO IDEA how to get started with javascript plugins. For starters, I added nouislider in the package.json. Furthermore, I've also create the Slider class, blade and JS file as follows:...

how to custom actions on create record

how custom actions if the actions on create record, because im confuse after click the button actions then can generate pdf or something update data from im input on view create ? ``` protected function getFormActions(): array {...
Solution:
probably your repeater has a relationship.. if you want to access the repeater data in $data, you need to add ->dehydrated() in the repeater
No description

How to add table inside the tab content?

I have a task to create a view page on users. The scope is every tab content is different page/component so that it will not load heavily.. All the tabs are tables content example.. in my UserResource I created infolist for tab...

How to replace the original file, imageEditor

I use FileUpload imageEditor. How to replace the original file, not create a new file again with v1, v2, v3, etc.? ```php...
No description

Delete relations when delete a model

How do you do this? Currently only the immediate model in question gets deleted, all its relations still hangs in the DB like ghosts...

Not able to filter table on custom livewire component

What I am trying to do: I try to filter a table implemented in a custom livewire component. What I did: I added the HasTable and HasForm contracts and the useInteractsWithTable and the useInteractsWithForm traits in my custom livewire component. I also implemented the table function, my records are well retrieved and displayed then i added a SelectFilter to filter on a category field....

Adjusting repeater select box values dynamically

Is there a way to change the contents of a select box in a repeater based on the user selection on another component. I currently have two select boxes in a repeater, I want to set the second ones options based on the response to the first one.
Solution:
Figured out the solution, I'm not sure if it's the best way to do it but it's the way I've done it ```php Repeater::make('countries_worked_in') ->schema([ Select::make('continent')...

Panel Authorization

Hi! I have a "Orders" resource, and a "My Orders" resource. How should I define policies? since a user should always viewAny order when enters MyordersResource... and don't have access to viewAny() when entering "Orders" ? Only admins can see all Orders. Both resources use the same model. Thanks!...

filament()->getTenant() null in bootUsing

When dd'ing filament()->getTenant() in the panels bootUsing method it returns null no matter where I navigate to