How to separate a resource from Tenants

Hello, I have these 2 resources InviteResource and InviteSentResource which are displaying for each Tenant. I would like to separate these 2 resources from the Tenant scope and also change the route which is without the tenant slug. Please let me know how to do that? I tried "protected static bool $isScopedToTenant = false;" in the resource page but it seems to display same records in both tenants which is good but the routes still have the tenant slug. Thank you
No description
7 Replies
toeknee
toeknee6mo ago
You would need to not register those resources in the tenant, then add them to a non-scoped tenant really.
BKF Dev
BKF Dev6mo ago
Just update this : public static function getEloquentQuery(): Builder { return parent::getEloquentQuery() ->whereTenantId(getCurrentTenantId()) <--- add this ->withoutGlobalScopes([ SoftDeletingScope::class, ]); }
mohdaftab
mohdaftabOP6mo ago
Thank you so much, I will try this. Thank you so much, I will try this as well. @toeknee @BKF Dev both suggestions work but the routes are still like /dashboard/company-1/invitations or if the tenant ie company 2 then the slug is also company-2/invitations is it possble to please make it like dashboard/invitations ? Thank you
toeknee
toeknee6mo ago
Thats a non-tenant scope so you'd need to build a non-tenant scopes panel? And ensure that class is used.
mohdaftab
mohdaftabOP6mo ago
I see the editprofile with isSimple: true has no tenant route but it works I don't want users to login to other panels to see the resource because there will be many more resources which are shared between tenants but I need the route somehow to be without tenant slug. I hope there is a way to do that the reason why I need to invite users to join the tenant by displaying the invitations in the table where they can either accept or reject but the invitations for other tenants to the user inside another tenant doesn't seem to make sense which is why I need kind of a independanttable for them to see all the invitations.
toeknee
toeknee6mo ago
That page has isTenantSubscriptionRequired = false, have you tried that?
mohdaftab
mohdaftabOP6mo ago
No, let me try that didn't help 😦
Want results from more Discord servers?
Add your server