0
I’m testing a API I am developing, in localhost I can make a certain request and it returns to me everything 'ok'. By doing the same test on a server, it is returning a 'Route [login] not defined.' Since I’m not associating any middleware authentication to my API and neither associating in the builder of my controller.
public function getListById($id)
{
$user = DB::table('dbTestes')->where('id', $id)->get();
return response()->json($user);
}
//Rota API:
Route::get('/ponto/edit/{id}', 'PontoController@getListById');
*I’m accessing the same database.
Where are you saying the access URL?
– Suporte Escritoriomovel
meudominio.com/api/...
– user108720
On your router, did you specify that middleware is api? The Laravel tbm has a specific file to create api routes, unlike when you use the web Routes, besides, if for some reason you are in a protected route the Laravel is redirecting you to the login route, which in this case does not exist
– Morkhusz
No, no middleware is defined in the API routes.
– user108720