Laravel Middleware - A Complete Tutorial

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 9

  • @rawanahmed4447
    @rawanahmed4447 Год назад +1

    U have a great way to simplify things and make it easier 🌸

    • @TechToolIndia
      @TechToolIndia  Год назад

      Glad you think so!
      Please Subscribe to the channel.

  • @unravelledwatch3004
    @unravelledwatch3004 Год назад +1

    great video bro

  • @mibrahim4245
    @mibrahim4245 2 года назад +2

    Hi, can we use it to check the sign in, if admin -> go to admin page .. if normal user-> go to home page ?
    do you have a video on this ?
    thanks

    • @TechToolIndia
      @TechToolIndia  2 года назад +1

      Hi Ibrahim
      Yes you can write this either in RedirectAfterLogin or HomeController
      Add a simple check with role of and redirect based on the condition.
      Hope this help

    • @mibrahim4245
      @mibrahim4245 2 года назад

      @@TechToolIndia thanks

  • @mrlee-oo6zz
    @mrlee-oo6zz 2 года назад +2

    To make it simple
    Route::get('/profile', function () {
    //
    })->middleware('auth');

    • @TechToolIndia
      @TechToolIndia  2 года назад

      Hey
      You can use middleware at different places from routes to controller
      Thanks for putting your thoughts
      Consider subscribe channel