Tim van Heugten
php noob here - how should i create a crud page available to users
If the public version is like a medium.com it would probably be best outside a panel on a public route. That would be default Laravel stuff (including routes for catagories, topics, search, etc)
7 replies
Empty hidden fields
Multiple ways to go about this. On toggle you could set ‘the other value’ to null or on submit you could check the toggle and set the other value to null. What I also always like to do is self validate the model for this case, so that if whatever possible edge case / bug occurs the model can’t be saved.
4 replies
Dynamically set current panel
Maybe you can borrow some inspiration here: https://github.com/filamentphp/filament/discussions/2058#discussioncomment-7537089 - you can look into the tenancy package as well.
3 replies
Can I add verification system In multi tenant!
Two approaches; create a new model (ie. ShopRequest with the minimum required fields needed to create a shop) and create logic to view them as admin, maybe even edit them to make corrections and then create an actual shop from them (copying the fields). This approach is often used for creating new users (ie. user invites). Another approach is to create the actual shop with a flag (needs_approval boolean or approved_at datetime) and change all queries that resole shops to only include the ones that are approved (except for the admin, who would be able to see them and toggle approval).
3 replies
In multi tenant how can I remove functionality that user can't create team!!
Read about policies and on your ShopPolicy make sure users are not allowed to create (but you as admin can). As far as I remember Filament respects this policy and the create new shop will disappear.
3 replies
Implement multi level tenancy
However, I did remove the email unique from the user model so someone can use the same email for creating an account for customers at different tenants. So the email needs to be unique per tenant per use type (as the tenant user could potentially be a user for a customer of his own or another tenant). This required some custom logic to basic validate for the different user types.
8 replies
Implement multi level tenancy
I found this useful: https://ollieread.com/archive/read/laravel-multi-tenancy-avoiding-over-engineering/#identification-middleware
8 replies
Implement multi level tenancy
I’m doing something similar for a new project. I use three panels though (admin, tenant, customer). Tenants can set a slug, which is used as a subdomain, and logo and color. This tenant panel is basically as described in the docs using multi tenancy. On the customer panel I created middleware that checks the slug (subdomain) to load the tenant and make it accessible throughout the rest of the process. For example to set the panel’s color, brand name or logo. On the user model I introduced a type (admin, tenant, customer) which basically functions as a layer on top of roles.
8 replies
How to Implement Multi-Tenancy with Admin View Option in FilamentPHP v3?
Basically like this: https://github.com/filamentphp/filament/discussions/10391#discussioncomment-7904045
17 replies
How to Implement Multi-Tenancy with Admin View Option in FilamentPHP v3?
I’m in the same boat. I created a second panel, but I’m reusing the same resources. Based on the panel I tweak some stuff like showing an extra tenant name column or field. Is this bad practice?
17 replies