user(); return ($user !== null && $user->hasPermission('admin/analytics') === true); } /** * Return if the current model is creatable. * * @return boolean Allow creating model. */ public static function creatable() { return true; } /** * Return if the current model is updatable. * * @param Model $model The model. * @return boolean Allow updating model. */ public static function updatable(Model $model) { $user = auth()->user(); return ($user !== null && $user->hasPermission('admin/analytics') === true); } /** * Return if the current model is destroyable. * * @param Model $model The model. * @return boolean Allow deleting model. */ public static function destroyable(Model $model) { $user = auth()->user(); return ($user !== null && $user->hasPermission('admin/analytics') === true); } }