redirect user after login base on role in spatie with laravel code example
Example 1: how to redirect a particular user role to a page after login laravel
protected $redirectTo = RouteServiceProvider::HOME;
Example 2: how to redirect a particular user role to a page after login laravel
<?phpnamespace App\Http\Middleware;use Closure;use Illuminate\Auth\Middleware\Role as Middleware;use Illuminate\Support\Facades\Auth;class Role { public function handle($request, Closure $next, String $role) { if (!Auth::check())