*/ public function rules(): array { return [ 'customer_name' => ['required', 'string', 'max:255'], 'customer_phone' => ['required', 'integer', 'between:61000000,71999999'], 'customer_address' => ['nullable', 'string', 'max:255'], 'payment_type' => ['required', 'string', Rule::in(array_keys(OrderPayment::oldButGoodTypes()))], 'notes' => ['nullable', 'string', 'max:255'], 'order_website' => ['nullable', 'string', 'max:255'], 'images.*' => ['nullable', FileRule::image()->min('1kb')->max('10mb')], ]; } /** * Get the error messages for the defined validation rules. * * @return array */ public function messages(): array { return [ 'payment_type.in' => sprintf('Valid sources: %s', implode(', ', array_keys( OrderPayment::oldButGoodTypes() ))), ]; } }