Enable CORS via Middleware in Laravel

If you don’t have any idea what CORS is, then please skip this.

Save as CORS.php in the Middleware folder.

Edit app\Http\Kernel.php and add your middleware in api / routeMiddleware.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.