BlogEtc icon indicating copy to clipboard operation
BlogEtc copied to clipboard

Unexpected 'Gate' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

Open t8ysn opened this issue 5 years ago • 4 comments

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 avatar Jan 13 '21 21:01 t8ysn

@t8ysn check my package: https://github.com/vhessam/laravel-blog-package

samberrry avatar Jan 14 '21 21:01 samberrry

Hi @t8ysn Have able to get solution concern that, since I have the same problem

careerhub-source avatar Apr 01 '21 19:04 careerhub-source

paste the code in your boot method, It should work.

OkubeEmmanuel avatar Jun 10 '21 02:06 OkubeEmmanuel

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 .

careerhub-source avatar Jun 10 '21 05:06 careerhub-source

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

tungtata avatar Oct 18 '22 11:10 tungtata