简体   繁体   中英

registering new user when authenticated in laravel

i have classified my users table to have role in it Admin Student Teacher

as an admin i can register new student/teacher. but when im authenticated as an admin, the register button went straight to home.

the problem is i can register new account when i am a guest.

i have tried to change RedirectIfAuthenticated.php to /register

but i got this error;

it said i got too many error

You are getting redirected too many times to the same page because of the IF statement that you have. You are checking if it's true. You need to redirect to the /register route only if It's false. With others words you need

if (! Auth::guard($guard)->check()) { 
    //your redirect here 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM