-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathapi.php
More file actions
29 lines (25 loc) · 1.08 KB
/
api.php
File metadata and controls
29 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
use App\Http\Controllers\Api\LicenseController;
use App\Http\Controllers\Api\TemporaryLinkController;
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 and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
Route::middleware('auth.api_key')->group(function () {
Route::post('/licenses', [LicenseController::class, 'store']);
Route::get('/licenses/{key}', [LicenseController::class, 'show']);
Route::get('/licenses', [LicenseController::class, 'index']);
Route::patch('/licenses/{key}/renew', [LicenseController::class, 'renew']);
Route::post('/temp-links', [TemporaryLinkController::class, 'store']);
});
Route::middleware('auth:sanctum')->group(function () {
Route::get('/user', fn (Request $request) => $request->user());
});