LaravelDaily / quickadmin

Quick adminpanel builder package for Laravel 5
MIT License
600 stars 192 forks source link

How to restrict admin for non admin user #105

Closed MKBLR23 closed 7 years ago

MKBLR23 commented 7 years ago

Hi,

I'm trying to to restrict non Administrator user but not working,

` public function handle($request, Closure $next, $guard = null) { if(Auth::check()){ if (Auth::user()->isAdmin()){ return redirect('/admin'); } }

    return $next($request);
}

}`

PovilasKorop commented 7 years ago

@Monilal what do you mean non-administrator user, it is restricted in our package - you're probably doing something outside of our package logic.

MKBLR23 commented 7 years ago

Like I have 3 user roles Administrator, User, Operator. if user role is Administrator than its can redirect to locathost:8080/admin otherwise its redirect to locathost:8080/home page, actually I'm trying to do only Administrator can access /admin URL. How can I do it.

PovilasKorop commented 7 years ago

This question is outside of our package functionality, it's in Laravel code, we don't provide such support.

MKBLR23 commented 7 years ago

thank you