Hi… i get the error mentioned in the title when i try to update a row in db. And the validation failes.
Routes.php In a group admin
//Kategorier
$routes->get('cat/list', 'CatController::index');
$routes->get('cat/create', 'CatController::create');
$routes->post('cat/store', 'CatController::store');
$routes->get('cat/edit/(:num)', 'CatController::edit/$1');
$routes->post('cat/update/(:num)', 'CatController::update/$1');
$routes->get('cat/delete/(:num)', 'CatController::delete/$1');
in the controller
## Validation
$input = $this->validate([
'kategori' => 'required|min_length[3]',
]);
if (!$input) {
return redirect()->route('admin/cat/edit/'.$id)->withInput()->with('validation',$this->validator);
} else {
error message from debug bar
## Validation
83 $input = $this->validate([
84 'kategori' => 'required|min_length[3]',
85 ]);
86
87 if (!$input) {
88 return redirect()->route('admin/cat/edit/'.$id)->withInput()->with('validation',$this->validator);
89 } else {
With line 88 marked.
Is there enough info to answer?
Rgrds Bengt
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there @bengt,
I was doing some research for this and noticed your post on the CodeIgniter forum here, happy to see that you’ve got it working by updating the redirect to:
Regards, Bobby