RSS

Category Archives: Laravel

How to enable CORS in Laravel 5

How to enable CORS in Laravel 5

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

Advertisements
 
Leave a comment

Posted by on April 20, 2017 in Laravel

 

Tags: ,

Laravel 5.1 Useful Resources

 

Hosting

Lumen

https://github.com/lucadegasperi/oauth2-server-laravel

http://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/

http://mrgott.com/joomla/24-integrate-oauth2-server-into-lumen-to-secure-your-restful-api-with-access-tokens

http://loige.co/developing-a-web-application-with-lumen-and-mysql/

 

 
Leave a comment

Posted by on September 12, 2016 in Laravel, PHP

 

Tags: