Auth Multi Roles Login with Custom Middleware in Laravel 9

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • In Laravel middleware will filter all http requests when there is client making request, for example we can find out which request is unauthorized and need to redirect to login page or to register page. The main purpose is to filter out unwanted request which is mostly apply to role and permission user.
    Today I will show you how to create custom middleware in multiple roles login.
    ✅ Article: www.cambotutor...
    ✅ Source Code • Laravel Custom Middlew...
    ✅QR Code Scanner Android • Implement Barcode QR S...
    ✅Android Support Multiple Language • How to Implement Andro...
    ✅Android In-App Review • Rating 5 Stars In-App ...
    ✅Android In-App Update • Android Show Update Av...
    ✅Convert Web to Android App • How to Convert Web to ...
    ==============Create Ads in Android===============
    ✅Admob Banner + Interstitial Ads • How to Show Banner Ads...
    ✅Android Native Ad with Exit Dialog • [From Scratch] How to ...
    ✅Android Native Ad in Recycler View • [From Scratch] How to ...
    ✅Android Native Template Ads in Activity • How to Add Native Ads ...
    ✅Android Playlist Admob Tutorial • How to Insert Banner, ...
    For more tips and quick code in programming development tutorials on the channel homepage...
    SUBSCRIBE www.youtube.co...
    Facebook - cambotu...
    ============================
    Music : RUclips Audio Library
    Template Subscription : mixkit.co/
    #laravel9 #laravel_tutorial #middleware #authentication

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

  • @spade6774
    @spade6774 Год назад +4

    for those have problem with webpack cli, you can actually just leave those part

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

    how can i use those routes for my flutter

  • @me_lvin7068
    @me_lvin7068 Год назад +4

    Great content. This is simpler and more understandable (especially for beginners) than any content I have already watched about user role authentication in Laravel 9.

  • @darylpiamonte1612
    @darylpiamonte1612 Год назад +2

    how about when registering it will redirect automatically in the response "You Don't have pwemission to access this page."

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

    Thanks for such great and simple tutorial 🌸 I am just asking about registration .. what are the steps to redirect each user to corresponding role page??

  • @hamzael-badaoui1736
    @hamzael-badaoui1736 Год назад

    it give me this eror
    Too few arguments to function App\Http\Middleware\UserRoleMiddleware::handle(), 2 passed

  • @johnmichaelcagadas2563
    @johnmichaelcagadas2563 8 месяцев назад

    I did not tried it yet but I think using this code if you are able tp login to the userpage you can also be able to redirect to admin using the routes

  •  Год назад

    webpack-cli] Error: Cannot find module 'C:\xampp\htdocs\onlineScholarshipSystem\webpack.mix'
    Require stack:
    i got this error sir, how can i solve this?

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

      If you work on Laravel 9 WebKit not default in webpack, you have to modified

    •  Год назад

      @@CamboTutorial how? 😅

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

      @@CamboTutorial how to fix it sir?

    • @92kmusic
      @92kmusic Год назад

      webpack.mix.js file another project copy and paste your page

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

    Property 'role' not found in \Illuminate\Contracts\Auth\Authenticatable|null solution?

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

    Guys, following this video, I do not need to install Spaties/Laravel-Permissions, right ? I mean, could use this and it's almost the same

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

    Thanks for video
    I use your code in my projects, but it take only one editor login. it is not refresing variables I am new to laravel please guide me

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

    Is it okey not to include creating using scaffold? like I want to create auth manually?

  • @oktoniuszevanyasimanungkal9554
    @oktoniuszevanyasimanungkal9554 3 месяца назад

    Great Help! Thank you

  • @VaibhavLonbale-x2u
    @VaibhavLonbale-x2u 8 месяцев назад

    How can I get rid of this error "Vite manifest not found at: C:\xampp\htdocs\laravel-role\public\build/manifest.json".

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

    Thanks! When if I want to add extra attributes to a user based on the role? Say the customer may have extra attributes that an admin does not need (i.e. cart FK)?

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

    Auth::user->role == $role (constant user not found) anybody to help?

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

      use "user()" instead of user". you use wrong syntax

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

    Great video! Guys, this error is fixed by the end of the video. if(Auth::check() && Auth::user->role == $role) Undefined constant Illuminate\Support\Facades\Auth::user

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

      same i dont know something wrong with user may use if(Auth::check() && Auth:user()->role ==$ role)

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

    Hi, may I ask if this also work with laravel-react js?

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

    Awesome Bro... Amazing video!!!

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

    Just a quick question, you use role="0" not role="admin" how does it know it's admin? Sorry just new on this Laravel thingy.

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

    when npm run dev, error on the webpack cli? what is the solution?

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

      Laravel 9 come with vite, I usually compile with webpack. Watch my video Laravel Enable Strong Password around 3:00 you can see I have configured that.

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

    Hey i am getting the error Undefined array key "" .
    Help me to solve this problem

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

      same here buddy , did you get solution?

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

    Thank you ❤❤ for uploading such a great tutorial

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

    I like background white. Better like you did before.

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

    Thank you nice video!!!!! 🤗🤗🤗

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

    mantap bang

  • @スイートエッグ
    @スイートエッグ 2 года назад

    tysm for the explanation, helps a lot ❤️

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

    good video

  • @dhavalrathod-vh1ud
    @dhavalrathod-vh1ud Год назад

    Best video for Multi login Very Help Full

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

    can we use enum instead of tinyInteger for role in database sir?

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

      yes, sure, but I prefer to use integer instead of enum.😀

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

    you are awesome!!!