getCurrentModel(); /** @var \App\Models\User|null $user */ $user = auth()->user(); $authorized = auth()->check() and $user->can('create', $model); if ($authorized) { $this->rules = $this->getRulesForAction(CrudAction::create()); } return $authorized; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return $this->rules; } }