Spatie Laravel Permission Package Tutorial | Using Middleware for permission and role #4

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • Laravel Permission package by Spatie
    Associate users with roles and permissions
    This package allows you to manage user permissions and roles in a database.
    Using Middleware for permission and role
    Full Python Beginner Playlist: goo.gl/UrcLw4
    Become My Patron here goo.gl/NcvDQh
    Angular Full 60 Minute Course goo.gl/TL2UFy
    To Join Whatsapp, follow this link chat.whatsapp.com/3tZbpzGfrKb...
    You can donate any amount via Paypal follow this link goo.gl/JhWsKC
    Join Our Slack Community - goo.gl/pqCjZH
    --You May Also Like --
    Real-Time Chat Series - goo.gl/ri42FD
    Git and Github series - goo.gl/BXyPxf
    Blog with Admin panel Series - goo.gl/S5JGyt
    Laravel Authentication Series: Multi Auth - goo.gl/TyCLlX
    Vue Beginner To advanced Series - goo.gl/1bjdGg
    Sublime Text Best Package Series - goo.gl/6phTPP
    Laravel Ajax Todo Project - goo.gl/p2xTPW
    Laravel 5.4 Full Beginner Playlist - goo.gl/zpKzhM
    Laravel 5.3 Hindi Beginner Tutorials - goo.gl/Kb3ikd
    ==================FOLLOW ME ==================
    Subscribe for New Releases!
    Twitter - / bitfumes
    Facebook - / bitfumes
    Instagram - / bitfumes
    (ask me questions!)
    -- QUESTIONS? --
    Leave a comment below and I or someone else can help you.
    For quick questions you may also want to ask me on Twitter, I respond almost immediately.
    Email me support@bitfumes.com
    Thanks for all your support!

Komentáře • 39

  • @vishalsrivastava9263
    @vishalsrivastava9263 Před 5 lety +1

    You are great man, your concept and way of teaching is so good.

  • @whitewisdom9682
    @whitewisdom9682 Před 2 lety

    YOU SEE THIS GUY, NAMBARR ONE LARAVEL GUY,
    i never had good sleep before this package because every system i created, that had custom role management, i never felt the sense of security. because some other guy on youtube poorly described spattie permission package, i avoided using it. but with this i think i'm on the right track to a good night sleep :)

  • @dr.d303
    @dr.d303 Před 2 lety

    Thankyou so much brother! your doing greate stuff! Keep doing! Love your content! ♥

  • @farookrajput5552
    @farookrajput5552 Před 3 lety +3

    I'm new to laravel but you helped me so much

    • @Bitfumes
      @Bitfumes  Před 3 lety +1

      Thanks for your love and support, keep learning. Follow bitfumes on twitter.com/bitfumes or facebook.com/Bitfumes to get the latest updates.
      bitfumes.com

  • @sumonchandrashil8406
    @sumonchandrashil8406 Před 4 lety +2

    This serious helped me a lot. Thanks BitFumes. Go Ahead Bro.

    • @Bitfumes
      @Bitfumes  Před 4 lety +1

      Thanks for your love and support, keep learning. Follow bitfumes on twitter.com/bitfumes or facebook.com/Bitfumes to get the latest updates.

  • @shavindipathirana
    @shavindipathirana Před 5 lety +2

    Awesome tutorials. .. Im new to laravel but these helped me so much...

    • @Bitfumes
      @Bitfumes  Před 5 lety

      Thanks for watching, please like Bitfumes on facebook/twitter to get the latest updates.

  • @user-el4bx4ni1n
    @user-el4bx4ni1n Před 3 lety

    Full of this series tutorial are watched by me, Thanks for helpful tutorial !

    • @Bitfumes
      @Bitfumes  Před 3 lety

      Thanks for your love and support, keep learning. Subscribe to bitfumes newsletters
      bitfumes.com/newsletters

  • @misterjames25
    @misterjames25 Před 5 lety

    Thanks a lot for the help

  • @afdhalyaned3176
    @afdhalyaned3176 Před 3 lety

    I like the way explain this thing.

  • @jaswantrathore2141
    @jaswantrathore2141 Před rokem

    Awesome great detailed tutorials👌👌

  • @ariel5515
    @ariel5515 Před 5 lety

    Greaaaat video!

  • @mukhlisraza
    @mukhlisraza Před 3 lety

    Realy Good tutorials

  • @tahseenalaa7030
    @tahseenalaa7030 Před 5 lety

    thanks alot.

  • @RoyVincentNiepes
    @RoyVincentNiepes Před 4 lety

    Thanks Bro! :D

  • @amjadataallah
    @amjadataallah Před 2 lety

    Awsome great detailed tutorials, but if you can make a tutorial multi auth on Spatie permission package for redirecting users depend on their role, that would be great

  • @kenjohnsiosan9707
    @kenjohnsiosan9707 Před 5 lety +1

    thank u so much for this tutorial. 😁

    • @Bitfumes
      @Bitfumes  Před 5 lety

      Thanks for watching, Please subscribe to bitfumes' course section. bitfumes.com/courses

  • @michaelkamau9565
    @michaelkamau9565 Před 4 lety

    Thanks!!

  • @mubeenali6813
    @mubeenali6813 Před 5 lety

    Hi ankur sir you are assigning a role or permission to the routes at web.php.If i don't want to assign middleware to the route as middleware('permission:edit post')?can i assign it another way because if i don't want to assign it manually by typing the 'permission:edit post' i want when a specific routes will call associated roles or permission my logic get??please answer me thanks in advance!

  • @naveenroy9932
    @naveenroy9932 Před 3 lety

    Super Tutorial

  • @gojamoja6719
    @gojamoja6719 Před 3 lety

    thanks man

  • @yudistiraanaga
    @yudistiraanaga Před 3 lety

    thanks sir

  • @EmadeldeenAbdAllah
    @EmadeldeenAbdAllah Před 3 lety

    Gratefully You are supper hero,

    • @Bitfumes
      @Bitfumes  Před 3 lety

      Thanks for your love and support, keep learning. Subscribe to bitfumes newsletters
      bitfumes.com/newsletters

  • @muhammadusmanafzal7237

    #Bitfumes, Sir we have added middlewares hard coded. but how we can change them dynamically from front end. Because client have to change role and permission from frontend. Sir plz reply

  • @sarder2008
    @sarder2008 Před 4 lety +1

    HI Thanks for the tutorial, but I am struggling to manage users after login to send them different dashboards. How can send the users to different inteterfaces when they login?

    • @ahmedragab4063
      @ahmedragab4063 Před 2 lety

      there is a middleware called RedirecIfAuthenticated go there and remove < return redirect(RouteServiceProvider::HOME); > then put if conditions on the Auth::user() to check his role/permission in table models_has_roles or Models_has_permissions then redirect the user to the required route name.
      Example:
      if(Auth::user()->hasRole('writer')) {
      return redirect()->route('post.create');
      }
      elseif(Auth::user()->hasRole('publisher')) {
      return redirect()->route('post.posts_waiting_to_publish');
      }

  • @alexo2537
    @alexo2537 Před 3 lety +1

    But how can you change the view according to the user's role? Because I can occupy the middleware but I always redirect to the HOME view when I log in.
    For example:
    - admin redirect to the dashboard view.
    - Seller redirect to Sales view.
    - Viewer redirect to report view.

    • @ahmedragab4063
      @ahmedragab4063 Před 2 lety

      there is a middleware called RedirecIfAuthenticated go there and remove < return redirect(RouteServiceProvider::HOME); > then put if conditions on the Auth::user() to check his role/permission in table models_has_roles or Models_has_permissions then redirect the user to the required route name.
      Example:
      if(Auth::user()->hasRole('writer')) {
      return redirect()->route('post.create');
      }
      elseif(Auth::user()->hasRole('publisher')) {
      return redirect()->route('post.posts_waiting_to_publish');
      }

  • @IRHostingCo
    @IRHostingCo Před 5 lety

    How to restrict the access to the entire folder contents? For example, we have folder as administrator and folder as user, the user shouldn't have access to all files that are located to administrator (all controllers which are created for admin).

  • @Tharunkumar143
    @Tharunkumar143 Před 5 lety +1

    But for me permission middleware is not working. 🤨

    • @Tharunkumar143
      @Tharunkumar143 Před 5 lety

      It may work if no space added between and after while passing argument... But it will good if the Spattie trim string after loop on.
      😁😁😁

  • @mahmoudmohamed-oo3xs
    @mahmoudmohamed-oo3xs Před 2 lety

    You are great man, your concept and way of teaching is so good.