merge([ 'published' => $this->boolean('published'), ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'name' => 'required|string|min:3|max:255', 'amount' => 'required|numeric|min:0|regex:/^\d+(\.\d{1,2})?$/', 'published' => 'required|boolean', ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'name' => trans('Nom'), 'amount' => trans('Montant (par jour)'), 'published' => trans('Publication') ]; } }