*/ public function rules(): array { $maxUploadKb = 1024; return [ 'documentation_category_id' => ['nullable', 'integer', 'exists:documentation_categories,id'], 'title' => ['required', 'string', 'max:220'], 'slug' => ['nullable', 'string', 'max:240', Rule::unique('documentation_documents', 'slug')], 'summary' => ['nullable', 'string', 'max:500'], 'body' => ['nullable', 'string'], 'status' => ['required', Rule::in([DocumentationDocument::STATUS_DRAFT, DocumentationDocument::STATUS_PUBLISHED, DocumentationDocument::STATUS_ARCHIVED])], 'is_featured' => ['nullable', 'boolean'], 'version' => ['required', 'string', 'max:50'], 'reference' => ['nullable', 'string', 'max:100'], 'attachment' => ['nullable', 'file', 'max:' . $maxUploadKb, 'mimes:' . implode(',', config('documentation.allowed_upload_mimes', []))], 'attachments' => ['nullable', 'array'], 'attachments.*' => ['file', 'max:' . $maxUploadKb, 'mimes:' . implode(',', config('documentation.allowed_upload_mimes', []))], ]; } }