Last active
June 20, 2020 22:20
-
-
Save blogcacanid/5023cd35678d52af34b2a39f28aead8d to your computer and use it in GitHub Desktop.
api.php Rest API Dengan JSON Web Token Laravel 7
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 | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| 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(); | |
// }); | |
// Route::group(['middleware' => 'api','prefix' => 'auth'], function($router) { | |
Route::group(['middleware' => 'api'], function($router) { | |
Route::post('register', 'JWTAuthController@register'); | |
Route::post('login', 'JWTAuthController@login'); | |
Route::post('logout', 'JWTAuthController@logout'); | |
Route::post('refresh', 'JWTAuthController@refresh'); | |
Route::get('profile', 'JWTAuthController@profile'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment