Heres the create method of my AuthController
protected function create(array $data) { return User::create([ 'phone' => $data['phone'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'role'=>$data['role'] ]); }
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am building a project that have Teachers, Students and Public, as users which i called ROLES. I am using Auth on Laravel 5.2 for authentication. I put SELECT drop down in the Registration and Login pages to contain these roles. I want If a teacher logs in, he will be taken to teacher landing page. If a student Logs in, be taken to student Landing Page. I was stuck on how to do this as the Auth have only one redirectTo='/'. I have tried to implement if(conditions) but it did not work for me. PLEASE HELP!!
Please or to participate in this conversation.