Angular/index.component.ts:
const Request = axios.create({
baseURL:'http://localhost:8000',
withCredentials: true
})
Request.get('/sanctum/csrf-cookie').then(() => {
Request.post('/').then((e) => {
console.log(e.data)
})
})Laravel/.env:SESSION_DOMAIN=localhost SANCTUM_STATEFUL_DOMAINS=localhost APP_URL=http://localhost:8000 FRONTEND_URL=http://localhost:4200Laravel/cors.php
'paths' => ['*'], 'allowed_methods' => ['*'], 'allowed_origins' => ['*'], 'allowed_origins_patterns' => [], 'allowed_headers' => ['*'], 'exposed_headers' => [], 'max_age' => 0, 'supports_credentials' => true,