06 - User Authorization in Laravel

preview_player
Показать описание
A look into authorizing user actions in #laravel.

Documentation:

Рекомендации по теме
Комментарии
Автор

To be honest this is the best 11 minutes worth to watch

ABEDALLAHGOZAH
Автор

Adamsın Great explanation, simple and direct to the point!

anarbairam
Автор

Thanks sir, it's was great video and it's very easy to understand. Thank you very much :)

developer_sagor
Автор

Thank you sir.. your explanation is easy to understand.

GreatCaleb
Автор

Hey Sir! that's a great effort and a great opportunities for those who wants to learn laravel. Thanks,

RehmanKhan-zvrl
Автор

Awesome. Please add test (API, web) and sanctum

debjit
Автор

Thanks mohamed.
For checking two moleds i prefer to use this:

$user->is($post->user);
Or:
$user->isNot($post->user);

lahoucineoldakdim
Автор

Hi Mohamed,
Thank you and to the Laravel Team for this great video.
Btw I sent a DM for you in Discord. I hope it is alright :-)

ArjonJasonCastro
Автор

Is their any way to use gates directly on routes while using resource routes, or we should check each gate inside the controller?

mohamadcheaib
Автор

Thank you a lot for your clear and understandable videos. I have a question. With many to many relationships between an Author and Tag models, how to authorize an Author to update tags in policy?

rezamortezaie
Автор

Thank you very much for this great video. 
Could you explain what is the best practice to use 'tokenCan()' in combination with Gate and Policy?

vlauciani
Автор

Hi sir can you make a tutorial how to create a reward Points system. The new user will have a default point and the admin can give them points and the user will use the point to redeem a item and also display total points.

galiathussaga
Автор

Hi Mohamed,

Sorry to message you here, but, I replied to you on our Twitter conversation. Thanks a lot. 😊

ArjonJasonCastro
Автор

Am I the only one or someone else also noticed the "son of a beach" drawing in the background ?
😂

mzeeshanzafar
Автор

The explanation of whether the user is admin is a little big foggy. Let me explain it the user should have a column named role. If you already has the migration up and running just do this: php artisan make:migration adding_role_to_users_table --table=users then define the role $table->boolean('is_admin'); like so and if you'd like to have multi roles add the role column as a string then think of keys for each role name.go to the fillable and add the role. Now back to the PostPolicy you check whether the role is Admin or not or what ever role you want to check.

ilyasszamouri