Laravel 11 Multi Auth: Admin, Teacher, and User | Implement Middleware #2

Sdílet
Vložit
  • čas přidán 20. 04. 2024
  • In this second part of our Laravel 11 Multi Auth series, we delve deeper into implementing middleware for managing user authentication and redirection based on user roles. Watch as we guide you through the process of redirecting different user roles to specific login pages when they are not authenticated.
    In this video, we'll cover:
    How to create middleware that checks the authentication status of admin, teacher, and regular users.
    Redirecting admins to the admin login page, teachers to the teacher login page, and regular users to the general login page.
    Ensuring secure and efficient role-based authentication in your Laravel 11 application.
    By the end of this tutorial, you'll have a clear understanding of how to manage multi-authentication in your Laravel 11 projects and enhance your application's security.
    Don't forget to like, comment, and subscribe for more in-depth tutorials on Laravel and other web development topics!
    Laravel 11 Multi Auth: Admin, Teacher, and User | Implement Middleware #2
    Our Playlists:
    OOP In PHP:
    • OOP - PHP
    Git Full Tutorial
    • GIT Tutorial
    Laravel 9:
    • Laravel 9
    Vue 3 Laravel 9 Tutorial:
    • Vue 3 Laravel 9
    Laravel Testing:
    • Laravel Testing
    Nuxt Js
    • NuxtJS
    Laravel And Vuejs
    • Laravel And Vuejs
    Laravel Notifications:
    • Laravel Notification
    Laravel And React Js
    • Laravel ReactJs
    Laravel Interview Questions And Answers:
    • Laravel Interview Ques...
    Laravel User Management System:
    • Laravel User Managemen...
    Laravel Multi Auth System
    • Laravel Multi Auth System
    Laravel Vue3 GraphQL
    • Laravel Vue 3 GraphQL
    Follow us:
    YoutTube: / ajayyadavexpo
    Instagram: / ajayyadavexpo
    Twitter : / ajayyadavexpo
    Linkedin: / ajayyadavexpo
    Github: github.com/ajayyadavexpo
    Please subscribe to my channel and share the video with your friends.
    #laravel #vuejs #laravel11 #laravel11Middleware #Laravel11AuthSystem #laravel11MultiAuth

Komentáře • 15

  • @asadferozi3961
    @asadferozi3961 Před 3 měsíci

    sir im very impressed with your teaching style 💕💕. Can you upload a video of laravel LMS project. plz in laravel 11

  • @md.imranhossain4034
    @md.imranhossain4034 Před 2 měsíci

    This is not available on your GitHub portfolio. I tried the same as your video, but I am getting an error. I thought I would download and match the code, but I did not find this on your GitHub portfolio.

  • @idealwebdeveloper
    @idealwebdeveloper Před měsícem

    Sir ek problem or h vo yh h ki LARAVEL 11 m sessions h vo database m store ho raha h or users table ka kar raha hai to Hume use teacher ya other table h agar uska karna hua to kaise hoga , pls tell me

  • @future_of_coding
    @future_of_coding Před 3 měsíci

    @ajayyadav Thanks a lot for quick response, unique way to took us to documentation.

  • @getmizan
    @getmizan Před 3 měsíci

    Can you please make a updated version on multi-tenancy using "tenancyforlaravel" for Laravel 11?

  • @ParTHiKMoDI
    @ParTHiKMoDI Před 3 měsíci

    sir, plase make a video on why use remember_token use in laravel and hoe can i use in our project

  • @ParTHiKMoDI
    @ParTHiKMoDI Před 3 měsíci

    Sir, Please make a new video on How to use remember_token in laravel why are use remeber_token use in laravel

  • @irfanakram
    @irfanakram Před 15 dny

    Hi, you don't make logout functionality, If default user logout with other guards user also logout at same time, can you tell me how to handle that problem, Thank you

    • @ajay-yadav
      @ajay-yadav  Před 10 dny

      you need to ensure that each guard has its own session

  • @narend
    @narend Před 2 měsíci

    Sir isme ek problem h, admin/dashboard pr redirect kr raha but koi user admin/profile page open kare to dubara login page pr redirect kr raha h

    • @narend
      @narend Před 2 měsíci

      admin/login pr redirect nHi kr raha

    • @ajay-yadav
      @ajay-yadav  Před 2 měsíci

      Okay, you can make one change in the Middleware\Authenticate.php file and in Middleware\RedirectIfAuthenticated.php. Locate the redirectTo method in both files and update it as follows:
      If the request route matches 'teacher.*', and 'admin.*' the wildcard character '*' ensures it matches all routes starting with 'teacher.
      if($request->routeIs('teacher.*')){

    • @narend
      @narend Před 2 měsíci

      ​@@ajay-yadav thanks sir, it's working properly

    • @narend
      @narend Před 2 měsíci

      ​@@ajay-yadav❤