Created
February 20, 2021 11:58
-
-
Save silkyland/1debff211295255ca4351c884bb4fa08 to your computer and use it in GitHub Desktop.
Api Auth Login, register, me, logout
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 App\Http\Controllers\AuthController; | |
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::post('/login', [AuthController::class, 'apiLogin']); | |
Route::post('/register', [AuthController::class, 'apiRegister']); | |
Route::middleware('auth:sanctum')->post('/logout', [AuthController::class, 'apiLogout']); | |
Route::middleware('auth:sanctum')->get('/me', [AuthController::class, 'me']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment