laravel / jetstream

Tailwind scaffolding for the Laravel framework.
https://jetstream.laravel.com
MIT License
3.95k stars 809 forks source link

what diffrent between Gate and hasTeamPermission? #278

Closed youyi1314 closed 3 years ago

youyi1314 commented 3 years ago

Description:

what diffrent between Gate::check('add_team_member', Team::find(1)) and User::find(1)->hasTeamPermission('add_team_member', Team::find(1)) because in blade i use Gate::check('add_team_member', Team::find(1)) it show false, but use User::find(1)->hasTeamPermission('add_team_member', Team::find(1)) it show true and try inside php artisan tinker also

Below is my JetstreamServiceProvider image

below is my teams table: image

below is my users table: image

below is my tinker result: image

Steps To Reproduce:

edit JetstreamServiceProvider image

edit app/Actions/Fortify/CreateNewUser.php image

php artisan optimize composer dumpautoload php artisan migrate:reset (and re create new user and teams with owner)

register new user than go to Edit Team Settings and this is my Team Settings Page image cant delete, add team member there.

driesvints commented 3 years ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.