Support for non-tenant managed resources and pages in a multi-tenant implementation
Hiya!
I've managed to get multi-tenant up and going, which is fantastic, where a tenant is required. I'm still stuck with the following
How do I recreate a new filament-page which is not filtered by tenant?
* I have a 'page' which is auto-loaded by the AdminPanelProvider. This by default works, when I click 'Register new client' - the URL building process must be different, as I receive
Even though on the navigation itself, I can see the tenant parameter being passed along. It is like the register page is trying to build the navigation for itself from a different relative perspective?
The page (helix) in this case is just a page and is not bound to an Eloquent model, either.
* I have an Eloquent model which is actually reference data. It is shared data (like country or email-address-type). The records are not intended to be filtered by tenant, nor will a tenant be managing the data (I will protect administration of this data via Laravel Pennant and permissions.
I receive:
Solution:Jump to solution
For now, that's the only way to do this π Other ways are hacky and does not fully work 100% of the time
8 Replies
I presume there is existing logic that is meant to accommodate this, or perhaps it's architected in a way that the 'tenant-based' area is separate from a 'core super-user admin' area. I'm trying to keep everything isolated to one environment where possible.
as a further clarification:
b
ecause it isn't just limited to 'resources' - general 'pages' appear afflicted by the same issue, at least when processed like the livewire 'register you client' starting point is used.
You can see the behaviour here: https://development.asmorphic.com/admin/ user [email protected] pwd 12345678 (don't worry, no sensitive info there)
You'll see that if you click 'Verizon' or 'Helix' the interface component (Livewire in the case of Verizon) - but if you select the admin dropdown and select 'register new client' you'll receive an error saying it's looking for
Which oddly, is the same thing that happened when I temporarily changed the path from 'admin' to 'app'
To see one that is an eloquent model but I won't want affected by tenants - see 'Countries' for example. https://development.asmorphic.com/admin/1/countries
Stuck with that issue as well. How to exclude non tenant related resource?
In regards to the 'client' relationship issue; you'll want to override getEloquentQuery on your resources. My use case was I wanted a tenant (Partner) to have access to all records (Vehicle) for their users (Partner -> User -> Vehicle). e.g.
yeah I think I saw that post - that expands the data to the wider dataset, but I'm at a loss if it's just a filament page of its own that doesn't care about tenancy.
for the meantime I've just created a new panel 'app' and moved all the tenancy based items into it and kept the 'super admin' stuff in /admin/' - but the 'Register new client' on the '/app' front still gets:
Missing required parameter for [Route: filament.app.pages.dashboard] [URI: app/{tenant}] [Missing parameter: tenant].
But that could be just adding whatever is needed to the newly created dashboard somehow
(but the fact it's looking for app.pages.dashboard for what is now app.pages.app.app-dashboard may have something to do with it, but then I don't see a dashboard base either and the /admin one still works. Still doesn't completely address the problem, but it at least has the feeling of getting closer
I would still prefer they all could exist happily together, so hopefully someone in the know sees this and takes an interest =]
nope, that doesn't work because HasTenants is within the User object, so unless I want to seggregate Users too (I do not) I'm still affected by the same issue
bump - it appears I'm not the only one chasing this one - there are a number of threads going at the moment and no real concrete solution. The "best" solution appears to be take the 'create another panel' approach. Is that really the best long term direction with this?
Solution
For now, that's the only way to do this π Other ways are hacky and does not fully work 100% of the time
Cool. Well at least that's a direction, albeit not ideal, I know I'm not doing something silly when there is a more obvious solution - cheers!
Yep, it's not ideal but for now - seems like the best
I am having trouble with this ... I have custom Edit Profile page, when go to /admin/new to create new tenant I got error [Missing parameter: tenant] .
Im hoping to exclude EditProfile pages from tenant