unsa-pis-be/routes/api.php

18 lines
541 B
PHP
Raw Normal View History

2022-06-14 01:21:39 +00:00
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\UserController;
Route::post('register', [UserController::class, 'register']);
Route::post('login', [UserController::class, 'login']);
Route::middleware("auth:sanctum")->group (function(){
Route::get('user-profile', [UserController::class,'userProfile']);
Route::get('logout', [UserController::class, 'logout']);
});
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});