Answer the question
In order to leave comments, you need to log in
How to set up routes correctly?
I want to set up Middleware Api routes, but I get a 404 error. It seems to me that I did not specify the path correctly. The path to the files starts with Auth and I don't understand how to substitute ['namespace' => 'Auth'] there. Can you suggest how to do it right?
Route::group(['prefix' => 'api', 'middleware' => ['api.auth']], function() {
Route::post("/login", ['Auth' => '[email protected]']);
Route::post("/logout", ['Auth' => '[email protected]']);
});
Answer the question
In order to leave comments, you need to log in
I fixed it myself
Route::group(['namespace' => 'Auth', 'middleware' => ['api']], function() {
Route::post('/signup', ['uses' => '[email protected]']);
Route::post("/login", ['uses' => '[email protected]']);
Route::post("/logout", ['uses' => '[email protected]']);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question