1//install
2composer require laravel/sanctum
3
4// vendor
5php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
1use Illuminate\Http\Request;
2
3Route::post('/tokens/create', function (Request $request) {
4 $token = $request->user()->createToken($request->token_name);
5
6 return ['token' => $token->plainTextToken];
7});
1composer create-project --prefer-dist laravel/laravel appname
2
3composer require laravel/sanctum
4
5php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider"
6
7composer require laravel/jetstream
8
9php artisan jetstream:install inertia
10
11php artisan migrate
12
13npm install
14
15php artisan vendor:publish --tag=jetstream-views
16
17php artisan serve
18
19npm run hot