Welcome Guest, Not a member yet? Register   Sign In
route cannot be found while reverse-routing.
#3

(05-19-2021, 08:42 PM)InsiteFX Wrote: You have no admin/cat/edit/ route did you mean 'cat/edit/'.$id

the route is in a route group...
PHP Code:
// Admin routes
$routes->group("admin", ["filter" => "auth"], function ($routes) {
    $routes->get("/""home::index");
    
$routes->get('listusers''User::list', ['filter' => 'auth']);
    
$routes->get('viewuser''User::view', ['filter' => 'auth']);

    
//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'); 

When typing the adress: localhost/admin/cat/edit/1 it works fine. Its just when i try to edit and it fails on validation i get this error.
If i try to create a new using admin/cat/create it works fine... so the code below works fine...
PHP Code:
       ## Validation
        
   $input $this->validate([
            
  'kategori' => 'required|min_length[3]|is_unique[kategori.kategori]',
        
   ],
        
   // ERRORS
            
   'kategori' => [    'min_length' => 'Kategori må inneholde minst 3 bokstaver',
            
                       'is_unique' => 'Denne kategorien finnes allerede']
            ]);
  
           
if (!$input) {
            
  return redirect()->route('admin/cat/create')->withInput()->with('validation',$this->validator); 
        
   } else { 
Reply


Messages In This Thread
RE: route cannot be found while reverse-routing. - by bengtdg - 05-19-2021, 11:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB