lundi 5 novembre 2018

Using multiple controllers in the same route gets route undefined

I get an error of undefined route when using multiple controllers in the same route:

Here is the code my controllers:

public function triealphabet(){
    $list_grocery = miscellaneous::all();
    $list_grocery = $list_grocery->sortBy('name');
    return view('markets.miscellaneous')->with('list_grocery',$list_grocery);}
public function triecreation(){
    $list_grocery = miscellaneous::all();
    $list_grocery = $list_grocery->sortBy('created_at');
    return view('markets.miscellaneous')->with('list_grocery',$list_grocery);}

and here are my routes code :

Route::get('/miscellaneous','groceryController@listGrocery')->name('groceriesmarket'); 
Route::get('/miscellaneous','groceryController@triealphabet')->name('triealphabet');
Route::get('/miscellaneous','groceryController@triecreation')->name('triecreation');

P.S: If I use an other route path like '/miscellanous-tri-alphabet' I don't get any other errors, but other than that I get an error of undefined route



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire