jeudi 1 août 2019

How to fix "Laravel redirect to the same login page" and middleware return false all time?

Work in server (same code) but in localhost it return false always I have tried many ways.

I have tried Laravel build-in function login and so far the result always return false while debugging.

//Middleware RedirectIfAdmin

namespace App\Http\Middleware;

use Closure; use Illuminate\Support\Facades\Auth;

class RedirectIfAdmin { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @param string|null $guard * @return mixed */ public function handle($request, Closure $next, $guard = null) { $auth=Auth::guard('admin'); if (Auth::guard($guard)->check()) {

        return redirect('admin/dashboard');
    }
    return $next($request);
}

}

I will add other code also if needed please tell me I am a new to ask question here. Please guide me.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire