- composer create-project laravel/laravel
- composer require laravel/sanctum
- php artisan migrate
- app/Http/Kernel.php
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
-
App\Models\User добавил трейт HasApiTokens
-
докинул миграцию на nullable name
-
написал UserSeeder, вызов
php artisan db:seed --class=UserSeeder
-
composer require laravel/ui
-
php artisan ui:auth
-
В .env SANCTUM_STATEFUL_DOMAINS="sanctum.laravel"
-
php artisan ui bootstrap
-
php artisan ui vue
-
npm install
-
npm install vue router//npm install --save vue-router
-
создал свой /layouts/app.blade.php с vite
@vite(['resources/js/app.js', 'resources/sass/app.scss'])
-
js/router.js
-
В
config\cors.php
ставим'supports_credentials' => true,
-
resources\js\bootstrap.js
window.axios.defaults.withCredentials = true;