mercredi 1 février 2023

laravel dynamic routing showing 404 not found

I have created a route to pass dynamic parameters to controller but when i serve url it shows me for not found here is my route and controller I create

Routes

Route::get('/admin/managers/{method}/{id}', 
    [
        SetupController::class, 'managers'
    ]
);

Controller

public function managers($method, $id) {
        if($method == 'create') {
            return view('admin.pages.create-manager'); 
        } elseif($method == 'create') {
            echo $id;
            return view('admin.pages.create-manager'); 
        } else {
            return view('admin.pages.managers'); 
        }  
    }

When i serve url localhost/public/managers it shows me 404 not found but when i serve localhost/public/managers/create/1 the page is loading then can anyone hep me out why exactly is it happening



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire