Skip to content

Commit dddb022

Browse files
committed
Customize messages and filename
1 parent e0c7541 commit dddb022

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/WizardStep.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function omit(): bool
8888
*/
8989
public function process(Request $request): StepResult
9090
{
91-
$data = $this->validate($request, $this->rules());
91+
$data = $this->validate($request, $this->rules(), $this->messages(), $this->customAttributes());
9292

9393
return collect($this->fields())
9494
->mapWithKeys(fn (Field $field) => [
@@ -180,4 +180,22 @@ protected function rules(): array
180180
->mapWithKeys(fn (Field $field) => [$field->name => $field->rules])
181181
->all();
182182
}
183+
184+
/**
185+
* The custom validation messages
186+
*
187+
* @return array<string, string>
188+
*/
189+
protected function messages(): array {
190+
return [];
191+
}
192+
193+
/**
194+
* The custom validation messages
195+
*
196+
* @return array<string, string>
197+
*/
198+
protected function customAttributes(): array {
199+
return [];
200+
}
183201
}

0 commit comments

Comments
 (0)