mergeInertiaPicture(); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'name' => 'required|string|between:3,255', 'exercice' => ['nullable', new Enum(YearsEnum::class)], 'status' => ['required', new Enum(DocumentStatusEnum::class)], 'published_at' => 'nullable|date', 'unpublished_at' => 'nullable|date|after:published_at', 'path' => $this->pictureRules('nullable|file|mimes:pdf|max:10240'), 'issuu_path' => 'nullable|string|between:3,1000', 'is_issuu' => 'required|boolean', 'tags' => 'nullable|array', 'tags.*' => 'integer|exists:document_tags,id', 'categories' => 'nullable|array', 'categories.*' => 'integer|exists:document_categories,id', ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'issuu_path' => trans('validation.custom.issuu_path'), 'is_issuu' => trans('validation.custom.is_issuu'), ]; } }