Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (31 sloc) 1.15 KB
use Illuminate\Http\Request;
| API Routes
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
'middleware' => 'api',
'prefix' => 'auth',
], function ($router) {
Route::post('login', 'AuthController@login');
Route::post('logout', 'AuthController@logout');
Route::post('refresh', 'AuthController@refresh');
Route::post('me', 'AuthController@me');
Route::group(['middleware' => 'jwt.auth'], function ($router) {
Route::post('books/create', 'BookController@store');
Route::patch('books/{id}/update', 'BookController@update');
Route::delete('books/{id}/delete', 'BookController@destroy');
Route::get('books', 'BookController@index');
Route::get('books/{id}', 'BookController@show');
You can’t perform that action at this time.