test_laravel/routes/api.php

23 lines
631 B
PHP
Raw Normal View History

2025-03-23 21:42:28 +08:00
<?php
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();
});
2025-03-27 17:46:07 +08:00
Route::get('/test', function () {
2025-04-01 00:01:43 +08:00
return ["msg" => "success", "data" => [], "status" => 200];
2025-03-27 17:46:07 +08:00
});