['sometimes', 'uuid'], 'account_id' => ['required', 'exists:accounts,id'], 'category_id' => ['nullable', 'exists:categories,id'], 'description' => ['required', 'string'], 'description_iv' => ['required', 'string', 'size:16'], 'transaction_date' => ['required', 'date'], 'amount' => ['required', 'numeric'], 'currency_code' => ['required', 'string', 'size:3'], 'notes' => ['nullable', 'string'], 'notes_iv' => ['nullable', 'string', 'size:16'], ]; } public function messages(): array { return [ 'account_id.required' => 'The account is required.', 'account_id.exists' => 'The selected account does not exist.', 'category_id.exists' => 'The selected category does not exist.', 'description.required' => 'The description is required.', 'description_iv.required' => 'The description IV is required.', 'description_iv.size' => 'The description IV must be exactly 16 characters.', 'transaction_date.required' => 'The transaction date is required.', 'transaction_date.date' => 'The transaction date must be a valid date.', 'amount.required' => 'The amount is required.', 'amount.numeric' => 'The amount must be a number.', 'currency_code.required' => 'The currency code is required.', 'currency_code.size' => 'The currency code must be exactly 3 characters.', 'notes_iv.size' => 'The notes IV must be exactly 16 characters.', ]; } }