You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do this too, but we don't have a strict requirement to switch domains when we impersonate a user. For Spatie's multi tenancy solution you can use middleware to set the tenant. This assumes you have a relation set on your User-model.
We do this too, but we don't have a strict requirement to switch domains when we impersonate a user. For Spatie's multi tenancy solution you can use middleware to set the tenant. This assumes you have a relation set on your User-model.
public function handle(Request $request, Closure $next): mixed
{
if (app('impersonate')->isImpersonating()) {
auth()->user()->tenant->makeCurrent();
}
return $next($request);
}
We're not using this in production yet but I have not found any issues with it.
Are you able to further explain how you're accomplishing this?
I'm looking to accomplish something similar, except for a specific subdomain not a tenant. I am trying to impersonate a member guard class in my subdomain from a user class on my main domain
Hey,
I have multi-tenancy project with custom domains,
So, how can I impersonate users from other domains?
Thanks
The text was updated successfully, but these errors were encountered: