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
i Have this Middleware: \App\Http\Middleware\Tenant::class, i get tenant id from user Model
public function handle(Request $request, Closure $next)
{
if( Schema::hasTable('tenants') ) {
if (auth()->check()) {
$tenant = app('rinvex.tenants.tenant')->find(backpack_user()->tenants());
} else {
$tenant = null;
}
app()->singleton('request.tenant', fn() => $tenant); // setear null si se quiere ver todo
}
return $next($request);
}
This work for almost everything, except when i use Observer, is look like when Observer is add this make laravel execute models before middleware, and thats make ignore the scope.
How can i make this: get id from user model and make this package work with observer?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hello, first thanks for this package.
I have this scenario:
i Have this Middleware: \App\Http\Middleware\Tenant::class, i get tenant id from user Model
This work for almost everything, except when i use Observer, is look like when Observer is add this make laravel execute models before middleware, and thats make ignore the scope.
How can i make this: get id from user model and make this package work with observer?
Thanks in advance.
The text was updated successfully, but these errors were encountered: