This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
Route::group(['prefix' => 'auth'], function () { | |
Route::post('login', 'AuthController@login'); | |
Route::post('signup', 'AuthController@signup'); | |
// Las siguientes rutas además del prefijo requieren que el usuario tenga un token válido | |
Route::group(['middleware' => 'auth:api'], function() { | |
Route::get('logout', 'AuthController@logout'); | |
Route::get('user', 'AuthController@user'); | |
// Aquí agrega tus rutas de la API. En mi caso (EN MI CASO, EL TUYO PUEDE VARIAR) he agregado una de productos | |
Route::get("productos", function () { | |
return response()->json(\App\Producto::all()); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment