i'm validating a form with this:
public function update(UpdateExamenRequest $examenRequest, UpdateResultadoRequest $resultadoRequest)
{
$examenRequest->validated();
$resultadoRequest->validated();
This are the rules in UpdateExamenRequest
public function rules()
{
$this->redirect = url()->previous();
return [
'Paciente_id' => 'required|string|max:10',
'Examen_id' => 'required|string|max:10',
'Nombre' => 'required|string|max:50',
'Descripcion' => 'nullable|string',
];
}
public function messages()
{
return [
'Paciente_id.required' => __('Paciente_id.required'),
'Examen_id.required' => __('Examen_id.required'),
'Nombre.required' => __('Nombre.required'),
'Nombre.string' => __('Nombre.string'),
'Nombre.max' => __('Nombre.max'),
'Descripcion.string' => __('Descripcion.string'),
];
}
My routes:
Route::get('/', function () {
return view('auth.login');
})->middleware('guest');;
Route::get('/welcome', function () {
return view('welcome');
})->name('welcome');
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');
require __DIR__ . '/auth.php';
Route::resource('pacientes', PacientesController::class)->middleware('auth');
Route::resource('examenes', ExamenesController::class)->middleware('auth');
Route::resource('resultados', ResultadoController::class)->middleware('auth');
i'm having a situation, and i've really don't know whats happening. The validation sends me to the show view, that i haven't created yet, there is a video: https://youtu.be/S-PtTdUH13Y