generated from Flycro/laravel-breeze-api
21 lines
642 B
PHP
21 lines
642 B
PHP
<?php
|
|
|
|
use App\Http\Resources\UserResource;
|
|
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:sanctum'])->get('/user', function (Request $request) {
|
|
return new UserResource($request->user()->load('roles'));
|
|
});
|