/**
* Register any application authentication / authorization services.
*
* @param \Illuminate\Contracts\Auth\Access\Gate $gate
* @return void
*/
public function boot()
{
$this->registerPolicies();
//GateContract $gate
\Gate::define('update-widget-item', 'App\\Http\\Controllers\\UserController@ability');
\Gate::define('edit-question', function ($user, $question) {
return $user->id === $question->author_id;
});
//[0]['id']
}