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?
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.
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.
To be honest this is the best 11 minutes worth to watch
Thanks sir, it's was great video and it's very easy to understand. Thank you very much :)
Thank you sir.. your explanation is easy to understand.
Hey Sir! that's a great effort and a great opportunities for those who wants to learn laravel. Thanks,
You're welcome :)
Thanks mohamed.
For checking two moleds i prefer to use this:
$user->is($post->user);
Or:
$user->isNot($post->user);
Awesome. Please add test (API, web) and sanctum
Thanks Mohamed From Morocco
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 :-)
Hey. I don't open Discord a lot :) Catch me on twitter @themsaid
@@themsaid Yeah. I also sent the message in your twitter as well ;-)
Thank you, great tutorial
Thanks
Thanks a lot, bro.
Cool, descriptive
Is their any way to use gates directly on routes while using resource routes, or we should check each gate inside the controller?
Hi Mohamed,
Sorry to message you here, but, I replied to you on our Twitter conversation. Thanks a lot. 😊
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?
Thank you :)
thank you
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?
For example, is this right? $author->id === Tag::with('author')->pluck('id'); ??
Am I the only one or someone else also noticed the "son of a beach" drawing in the background ?
😂
Nice.
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.
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.
+