Gates (Permissions and Roles) | Laravel 10 Tutorial #36

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ธ.ค. 2024

ความคิดเห็น • 24

  • @kouzokiodin3623
    @kouzokiodin3623 5 หลายเดือนก่อน +3

    Sincerly i have watched more than 5 laravel courses but this course is the best one so far because of the way of explaining of this dude, Thanks man!

  • @hamzameski3297
    @hamzameski3297 10 หลายเดือนก่อน +3

    Honesly one of the most based on projects learning courses I've seen ever,
    Stuffs are explained as they should be,
    Free course at the same time,
    Thank you Sure so match for your efforts

  • @kadirertan8664
    @kadirertan8664 9 หลายเดือนก่อน

    Super easy to understand. Good job!🔥🔥🔥

  • @HamadAbdulla_7
    @HamadAbdulla_7 ปีที่แล้ว +2

    Great

    • @yelocode
      @yelocode  ปีที่แล้ว

      Thanks for watching.

  • @hollengrhen1
    @hollengrhen1 6 หลายเดือนก่อน +1

    Thanks. This reminds me of Jeffrey Way from Laracasts

    • @yelocode
      @yelocode  6 หลายเดือนก่อน

      Thank you.

  • @kreaweb-be
    @kreaweb-be ปีที่แล้ว +2

    Well explained. Good job!!
    You can cast the is_admin as boolean in the model.
    protected $casts = [
    'email_verified_at' => 'datetime',
    'password' => 'hashed',
    'is_admin' => 'boolean',
    ];
    For more complex applications, I like to use the Spatie Roles and Permissions package.

    • @yelocode
      @yelocode  ปีที่แล้ว

      Thanks for watching. Yea casts is definitely really useful here, specially for dates.

  • @ousssika5359
    @ousssika5359 ปีที่แล้ว +1

    thanks for the code as , usual , one issue use stille can access to login and register when you are already authenticated

    • @yelocode
      @yelocode  ปีที่แล้ว

      I fix this on the next episode, hopefully will upload it tomorrow or after tomorrow. But for a quick fix need to add the guest middleware to login and register routes. Thanks for watching.

  • @milesparker557
    @milesparker557 8 หลายเดือนก่อน +6

    For those using Laravel 11:
    `$this->authorize()` doesn't seem to work. Use `Gate::authorize()` instead.

    • @AnthonyEmacs
      @AnthonyEmacs 7 หลายเดือนก่อน +3

      you saved me , thanks!

    • @emiriin
      @emiriin 4 หลายเดือนก่อน

      You are a superhero, thanks!

  • @abdalkhalekchamkha3622
    @abdalkhalekchamkha3622 ปีที่แล้ว +1

    Great , can you do more Gate videos
    for example how can i handle many Overlapping permission
    such as group manager admin user post user and so one

    • @yelocode
      @yelocode  ปีที่แล้ว +1

      Thanks for watching. I will be covering this topic a little bit in the upcoming video. I will also be doing a mini course on handling roles and permission in Laravel soon hopefully.

    • @abdalkhalekchamkha3622
      @abdalkhalekchamkha3622 ปีที่แล้ว

      yeah thank you for what you doing for laravel community@@yelocode

  • @2eem
    @2eem 6 หลายเดือนก่อน

    Please tell me what to do if I create gate using Admin model?

  • @traiit
    @traiit 6 หลายเดือนก่อน

    Please share settings vscode or theme

  • @LoneTaha
    @LoneTaha 9 หลายเดือนก่อน

    thanks a lot!

  • @plusSilver
    @plusSilver ปีที่แล้ว +1

    Hi master, by some reason I have the next error:
    App\Providers\AuthServiceProvider::App\Providers\{closure}(): Argument #2 ($idea) must be of type App\Providers\Idea, App\Models\Idea given, called in /home/silver/Documentos/Laravel/plusSilver/vendor/laravel/framework/src/Illuminate/Auth/Access/Gate.php on line 548
    I hope you can help me, regards

    • @yelocode
      @yelocode  ปีที่แล้ว +1

      Thanks for watching.
      From the error it seems, you have not imported Idea class in your authServiceProvider.
      Adding "use App\Models\Idea;" to the top of the AuthServiceProvider file should solve the issue.
      I hope that fixes the issue.
      I also have the code for this episode on github, if you want to compare your code with it: github.com/yelocode/ideas/commit/5e7ec3dae5a3068858b1093a0dff2e961939e710

    • @plusSilver
      @plusSilver ปีที่แล้ว +1

      @@yelocode You are right, thank you very much

  • @Mr.Capone-
    @Mr.Capone- ปีที่แล้ว +1

    я тут! Я Русский - попа уже лица
    Я узкий ...... ляляляля Французский!!!