Laravel 7 redirect different pages users after login. Admin and User login redirect different page.

  • Published on Apr 25, 2020
  • Github link for the for this project
    How to do multiple authentication in laravel? Laravel 7 multi auth redirect users to different pages after login or register. Admin to the admin page and user to the user dashboard after login. Authentication in laravel 7.
  • Science & TechnologyScience & Technology

Comments • 92

  • Francisco Bressa
    Francisco Bressa Year ago +1

    just wanna to say thanks to your incredible tutorial. You helped me a lot

    MALIK AMJAD Year ago

    @Code Fisher Sir in 17:11 in the video u specify only one role and our requirement is to customize register view i.e add radio buttons for two roles one is for Client and the other is for User and if a user click on client then to redirect on client page and if he click on user then to redirect on User Page.

  • Haris Pervaiz
    Haris Pervaiz Year ago

    thankyou so much, i am really new to laravel and was finding solution have one login page with different user levels, this exactly what i was looking for, got some of my concepts cleared.
    Looking forward learning from you more

  • Shahzada Iqbal
    Shahzada Iqbal Year ago

    Awesome tutorial. Really informative. Thanks a lot sharing your knowledge.

  • Reniel Mallari
    Reniel Mallari Year ago +1

    Hi sir, can you do a tutorial using CRUD in laratrust, your tutorial is really a great help sir.

  • Murat Çalışkan

    thanks for the video, what is your idea when you compare lara trust and laravel permissions packages?

  • faizan bashir
    faizan bashir Year ago

    thanks so much for a great tutorial, is Laratrust is also available for version 5.8?? with the same method which is explained in video

  • N. Farhana salahudin

    Thank you so much... I try login as admin but end up in user page >.< Then saw your tutorial which is a really big help for me. So, i just need to put admin and user in different page. Thanks again. :3

  • Krizia Jane Frias

    Very Helpful. Thank you!

  • John Awali
    John Awali 2 years ago +1

    Good and clear explanation.Can you please explain how i can create Super administrator & administrator user from front end.

  • matthew imadiyi
    matthew imadiyi Year ago

    Hello sir, thanks for the lesson, tried running php artisan laratrust:seeder command
    But get an error: failed to open stream: No such file or directory
    Kindly help point me to what i might be doing wrong.
    Thank you so much.

    • matthew imadiyi
      matthew imadiyi Year ago

      @Code Fisher Thanks

    • 2Tux GTV
      2Tux GTV Year ago

      I encountered this problem, I installed the laratrust version 6.x. The problem is that its not compatible with the composer/laravel that you are currently using. What I did was I downgraded the Laratrust installer into 5.1/5.2 and it worked perfectly fine. I was able to create the Laratrust seeder.

  • Adil Khan
    Adil Khan Year ago

    Great tutorial. Enjoyed it

  • IanFroze
    IanFroze Year ago

    Awesome tutorial, thank you😆

  • Zawad Zamil
    Zawad Zamil 8 months ago

    Thanks a Lot💓
    If I found you earlier, I wouldn't waste the entire day!

  • Amos Abugri
    Amos Abugri Year ago +1

    @Code Fisher.. Nice tutorial am really looking forward to using it but i have a challenge. I have followed the video minute by minute but i dont seam to get php artisan db:seed to be working.
    It tells me that Target class [LaratrustSeeder] does not exist.
    Please help me.

    • Ayush Hiran
      Ayush Hiran 6 months ago

      Database is not getting seed in my case??
      Any idea please help

    • Nabila Zakaria
      Nabila Zakaria 11 months ago

      Is there any solution regarding this? Im having the same problem too

    • Mustapha Ah
      Mustapha Ah Year ago

      same problem, any solution?

  • Neeraj Sharma
    Neeraj Sharma Year ago

    Thank you sir, It really helped me a lot

  • Segal Gbenou
    Segal Gbenou 11 months ago +1

    Hi Sir ! Hope you fine ! At 9:46 (After installation of laratrust) : Adding LaratrustUserTrait make an error... can I continue with the video or how can I fix this error please ? 😰😥😓

  • Paweł Orleański

    Thank you very much. I needed it :)

  • Valeria Suarez
    Valeria Suarez Year ago

    Thank you, it was so helpful

  • Dũng Phạm
    Dũng Phạm Year ago

    Thank you for the very useful video

  • Budi Santoso
    Budi Santoso Year ago

    Thank you sir, God Bless You..

    MALIK AMJAD Year ago

    Hi, Sir My requirement is to add role on registration i.e Client, User etc this is Possible or Not???

      MALIK AMJAD Year ago +1

      @Code Fisher Sir in 17:11 in the video u specify only one role and our requirement is to customize register view i.e add radio buttons for two roles one is for Client and the other is for User and if a user click on client then to redirect on client page and if he click on user then to redirect on User Page.

  • Sharfudeen
    Sharfudeen Year ago +1

    Thank you so much for the video. Can you please upload the same for laravel 8? I'm starving for your video!!!

  • Sight Skill
    Sight Skill Year ago

    sir please make 3rd part of this video how to utilize this on admin panel like manage user roles update user delete user allow permisson with same laratrust...

  • Sergey Gabrielyan

    I have a question, but it has little to do with this video, if i use gates, is required also to have route middleware for separate admin and user areas?

  • vishal sirka
    vishal sirka 2 years ago

    sir, did you use middleware. to filter multi user

  • Mr Sahel
    Mr Sahel Year ago

    Nice, thanks so much

  • Nhất Anh Lê
    Nhất Anh Lê Year ago

    Thank you very much!

  • Farrukh Komilov
    Farrukh Komilov Year ago

    Awesome! Thanks bro!

  • Wan Rashid
    Wan Rashid Year ago

    sir how to pass data from user to admin?

  • El mehdi Hassouf
    El mehdi Hassouf Year ago

    you're the best brother thanks

  • John Awali
    John Awali 2 years ago +1

    How can I show login form if I type path /admin instead of :
    forbidden(User does not have any of the necessary access rights.)

    • John Awali
      John Awali 2 years ago

      @Code Fisher thank you for your reply its working fine

  • Towhid Hasan
    Towhid Hasan Year ago

    Sir, I'm Using Laravel version 8 with laravel 7 auth. but it's not installing

  • فيلم مع شعيب - Shu3aib Film

    how to make the auth with out using laratrust ??? please respond fast ty
    great job and thx for video

  • P.a.s Udayanga
    P.a.s Udayanga Year ago

    sir thank you so much

  • Hung Nguyen Thien

    I was not created
    'supperadministrator' user, 'adminitrator' user and 'user' user in 14:50 and 15:21 . Can you help me ? please (I installed Laravel version 7.17.2)

    • Patricio Cabo
      Patricio Cabo Year ago +1

      I had the same problem, by default create_user in "config\laratrust_seeder.php" is on false, change it to true

    • Chris Dumezweni
      Chris Dumezweni Year ago

      @Code Fisher I have the same problem, i ran "php artisan laratrust:seeder". Not working, empty users table.

  • Rahman Tutul
    Rahman Tutul Year ago

    but in registration form how can we define him/her as user or admin?

    • Rahman Tutul
      Rahman Tutul Year ago

      @Code Fisher I did . Thank you. But your teaching is pretty much good as i saw others!

  • Choszer Pictures
    Choszer Pictures Year ago

    I want to stop a logged in user from visiting the login page again, even by entering the URL after he's logged in, it should redirect to another page.
    Hence once logged in, you can't view the login page again, until you log out

  • Justin Ng
    Justin Ng Year ago

    Hi why is my users table not being seeded? Please advise.

  • Muhammad Latif
    Muhammad Latif Year ago +1

    Sir i'm not receiving data in users table after this command php artisan db:seed.
    but i'm receiving data correctly in other tables.

    • Syuhada Husna
      Syuhada Husna Year ago

      @tree🤘 Thankyou so much this helps me a lot

    • tree🤘
      tree🤘 Year ago +1

      @Muhammad Latif hi if I have the same problem too but i have fixed it. All you need to do is change "true" in the create_user in "config\laratrust_seeder.php" .

    • Muhammad Latif
      Muhammad Latif Year ago +1

      @Mukesh Sahu ohoo if you find any way please also inform me

    • Mukesh Sahu
      Mukesh Sahu Year ago +2

      struggling with the same problem

  • Jan Jansen
    Jan Jansen Year ago

    how to print role that attached into an account to my view homepage? Auth::user()->roles?

  • Ahamed Thilsan
    Ahamed Thilsan Year ago

    sir, how do I register another Super administrator?

  • Satheesh kumar
    Satheesh kumar Year ago

    But why another package !!!.
    We can create auth system without any packages then its easy to customise and don't want to see their document each time we customise our code
    as well as if we build our own code we can modify without any hesitation
    For example laravel 8 use tailwind css and livewire which is cool if you have enough knowledge of laravel auth system
    so my suggestion let's build your own code with laravel guards 🙂

  • Daniel Maruli Sitohang

    Thanks you so much...

  • Jerome Villaver
    Jerome Villaver 2 years ago

    Good day sir, Do you have Laravel 7 Vue.Js CRUD tutorial?

  • emmanuel boncales
    emmanuel boncales Year ago +1

    can you make this in laravel 8 sir with fortify? pls.

  • Sight Skill
    Sight Skill Year ago +1

    thanks sir...sir but while a user register is registering its showing only user how i can register a user a admin..

  • Bim Rh
    Bim Rh Year ago +1

    after i run php artisan db:seed my table user not have 4 record at the table. can you help me to solve this problem? thank u

    • Corina Lozan
      Corina Lozan Year ago

      ​@Alejandeo Dekiev guys, before run php artisan db:seed check in config/larastruct_ seeder.php 'create_users' => true, it will populate the user table

    • Alejandeo Dekiev
      Alejandeo Dekiev Year ago

      i have the same problem

  • harrison Oluchukwuebuka

    i am getting an error when i try to install laratrust sir,
    this is what i get
    ./composer.json has been updated
    Running composer update santigarcor/laratrust
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    Problem 1
    - santigarcor/laratrust[5.0.0, ..., 5.0.x-dev] require illuminate/auth ~5.2
    -> found illuminate/auth[v5.2.0, ..., 5.8.x-dev] but these were not loaded, like
    ly because it conflicts with another require.
    - Root composer.json requires santigarcor/laratrust 5.0.* -> satisfiable by
    santigarcor/laratrust[5.0.0, ..., 5.0.x-dev].
    Installation failed, reverting ./composer.json and ./composer.lock to their orig
    inal content.

  • MeD El Aatfi
    MeD El Aatfi 2 years ago

    thank u soo much

  • TuTzki
    TuTzki 8 months ago

    my laratrust_seeder.php is missing ... is this error ? or something ?? please help

  • Haysam Salik
    Haysam Salik Year ago

    will this work with fortify?

  • Jasper Besinga
    Jasper Besinga 11 days ago

    would this works on laravel 8?

  • Victor Miranda
    Victor Miranda Year ago

    generate seed files

  • Md. Sajidul Haque
    Md. Sajidul Haque Year ago +1

    u didn't show about the new register, and the whole thing was about predefined user and admin, what if I want to make a new admin and user?

    • Kiz NyctSlyer
      Kiz NyctSlyer Year ago

      Same problem, I can only make what is the default. I tried to make AdminRegisterController, but I can't create admin. Too few arguments error

  • Why & How
    Why & How 2 years ago +1

    how to create different login and register page for 2 users as like for student and a teacher

      STRIKER RON Year ago

      Create two different welcome page for teacher and student. And you have to create new tables for it

  • abhimanyu arora
    abhimanyu arora 9 months ago

    i am 1k like, thanks for the amazing video

  • M usman athar
    M usman athar Year ago


  • Ceylon Two Wheels

    register user is not working?

  • Mukesh Kumar Sharma
    Mukesh Kumar Sharma 2 years ago

    User does not have any of the necessary access rights. error --Please help me

  • Said ben hmed
    Said ben hmed Year ago

    what about laravel 8 ? any answers ?

  • Tanzim Ibthesam
    Tanzim Ibthesam Year ago

    Can we do that with Fortify?

  • Hasibullah Wardak

    Great video
    love from Afghanistan

  • MH
    MH Month ago


  • dhamkith
    dhamkith Year ago

    Good day

  • Stefan Caky
    Stefan Caky Year ago

    helo. koszi szepen.

  • Alexandr Iv
    Alexandr Iv 3 months ago

    у вас странный английский вы с какой страны

  • A orange
    A orange Year ago

    Im a simple human . I see a double adv in the middle of a video .. i hit dislike