'required|exists:users,id', /** * @example USD */ 'currency_code' => 'required|string|exists:currencies,code', 'due_at' => 'nullable|date', /** * @default pending */ 'status' => 'required|string|in:pending,paid,cancelled', // Status can be one of these values ]; } public function prepareForValidation() { $this->mergeIfMissing([ 'status' => 'pending', // Default status to 'pending' if not provided ]); } }