We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi guys,
does anyone have an example for a working middleware for Laravel 5.5 where you set the tenant by the users tenant id and with auth:api routes?
Route::middleware('auth:api:web')
The text was updated successfully, but these errors were encountered:
https://github.com/samtheson/voyagerlandlord/blob/master/app/Http/Middleware/Landlorder.php
Sorry, something went wrong.
<?php namespace App\Http\Middleware; use Closure; use HipsterJazzbo\Landlord\Facades\Landlord; use Illuminate\Support\Facades\Auth; class Tenancy { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $user = Auth::guard()->user(); Landlord::addTenant('tenant_id', $user->tenant_id); return $next($request); } }
No branches or pull requests
Hi guys,
does anyone have an example for a working middleware for Laravel 5.5 where you set the tenant by the users tenant id and with auth:api routes?
Route::middleware('auth:api:web')
The text was updated successfully, but these errors were encountered: