Unexpected 'Gate' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Describe the bug syntax error, unexpected 'Gate' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
I copied this into my AuthServiceProvider
Gate::define(\WebDevEtc\BlogEtc\Gates\GateTypes::MANAGE_BLOG_ADMIN, static function(?Model $admin){
// Implement your logic here, for example:
return$user&&$user->email==='your-[email protected]';
// Or something like $user->is_admin === true
});
@t8ysn check my package: https://github.com/vhessam/laravel-blog-package
Hi @t8ysn Have able to get solution concern that, since I have the same problem
paste the code in your boot method, It should work.
I already solve this, but the problem now is the style not working, when create post and post aome styles like italics, bold, h1 h2 etc is not saved and I can not find in frontend
On Thu, Jun 10, 2021, 05:34 Emmanuel Okube @.***> wrote:
paste the code in your boot method, It should work.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WebDevEtc/BlogEtc/issues/189#issuecomment-858233046, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALANJO2GGE3JQNDU3LVUJ23TSAQDRANCNFSM4WBO3WKQ .
Argument 1 passed to App\Providers\AuthServiceProvider::App\Providers{closure}() must be an instance of App\Providers\Model or null, instance of App\Models\User given, called in D:\Documents\GitHub\Nghien.Sale\vendor\laravel\framework\src\Illuminate\Auth\Access\Gate.php on line 536
I got this error