Closed gpedro closed 4 years ago
// AuthServiceProvider@boot Gate::before(function ($user, $ability) { return $user->hasRole($ability) ?: null; }); // HomeController@admin public function admin() { $this->authorize('superadmin'); return response()->json([ 'result' => 'welcome superadmin' ]); }
this allows better integration with the laravel eco-system and moves the custom middlewares to deprecation.
maybe we should add this in the documentation.
Thanks Pedro!
I'll check it to be added as enhancement.
Gate defined on 2.2.0
this allows better integration with the laravel eco-system and moves the custom middlewares to deprecation.
maybe we should add this in the documentation.