user() && $this->user()->hasPermission('edit-cpt'); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'label' => 'required|string|max:255', 'name' => 'required|string|max:255', 'type' => 'required|string|in:text,textarea,media,date,select,checkbox,number', 'options' => 'nullable|array', 'required' => 'boolean', 'sort_order' => 'integer', ]; } }