I'm developing website with Laravel framework and Sentinel I install Sentinel and it's work fine with login and user group data, but when i create my project i don't know how use it to differentiate user who has login as admin or not login.. i follow the indstruction code like this in controller:
public function dashboard()
{
$this->middleware('sentry.member:Admins');
return view('admin.dashboard');
}
But when i access the dashboard without login, it's still open dashboard.. how to fix it? how to redirect page to login if i'm not login yet?
In laravel to check a user while he is login or not login we do like this off-course this is works when we have installed sentry in laravel 5 framework.
public function dashboard(){
//already logged in go to dashboard or else login
if(Sentry::check()){
return Redirect::to('/admin.dashboard');
}else{
return Redirect::to('/login');
}
}