https://www.youtube.com/watch?v=PozYTvmgcVE
1. Add middleware
php artisan make:middleware Cors
return $next($request)
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
2. Register middleware as a route middleware
3. Use middleware in routes which support CORS
No comments:
Post a Comment