prouse_
Close modal inside afterStateUpdated in form
If anyone has any similar issue. After a lot of digging I found the solution which is actually very simple. You can run $livewire->unmountFormComponentAction() which will close the modal. Unfortunately this is not documented anywhere. @Dan Harrin maybe something to mention in the new v4 docs? 😊
12 replies
Close modal inside afterStateUpdated in form
I am using a Filament Select component. I have some logic in the afterStateUpdated and in there I would like to close the modal. It's okay if it's outside afterStateUpdated method as well as long as I can detect that a option has been selected.
12 replies
All Tenants option
@toeknee how would you change the value of scopeToTenant based on which tenant is selected? Since it's a static variable.
Also, in our case when selecting all, it should only be all Tenants which the user has access to. Not all tenants that exist in the application. Also, I do not like the fact of creating 1 global tenant record. Can you think of any other way to solve that part?
11 replies
Same field in all forms/resources
Yeah, between these two options I agree with you. What I'm looking for is a solution similar to how you can use a bootable trait in laravel models to add functionality to your model without needing to touch the rest of the model. Basically hooking into the form/table using the trait. Or some other similar solution. But I guess that is currently not possible with Filament.. 😞
10 replies
Same field in all forms/resources
I think it's more than just adding to all the forms. Because all resources that have this also needs to add in the table, and then also in the filters would be preferable. That's 3 places per resource now at least where we need to repeat the same code. So in that sense a trait or being able to extend a specific class would make it much cleaner.
10 replies
Same field in all forms/resources
Ideally we want to avoid needing to add the component into each form and then also the column into each table.
Would like to achieve it in a more elegant way. For example like how you can use traits in Laravel models and boot into it. Just adding a trait to the resource. Or extend CompanyResource or just add a property to the Resource.
I can't find any way though without overriding and changing too much of the core.
10 replies
Admin and super admin
A video about this would be great!
We have multi tenancy.
My main concern is basically. Should we use multiple panels? And if yes, how do we best reuse the fields/logic. Extending the resources or making classes for the fields which we can reuse?
And if we do not do multiple panels. How do we best make a clear seperation between regular fields and super admin fields.
18 replies
Admin and super admin
Thanks for your reply.
I definitely agree with you about not wanting to change to much structure. That's why I'm wondering what is the best way to achieve this in Filament.
The tests is a good way to ensure of course. But it's still easy for a new team member to add a new field and forget to make it hidden for regular users and also write test for it.
I'm looking for a way where we can put a clear seperation between the admin fields and super admin fields. Do you have any idea on the best way to achieve that?
18 replies
Admin and super admin
The visible solution I don't like since it's easy for a new team member to add a new super admin field and then forget about the is visible since all is in the same class/file. So somehow I am looking for a solution that puts a clear seperation between the regular fields and super admin fields.
18 replies