Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 2 years ago.
0

HI, I normally add this on the app/filter.php file


App::before(function($request)
{
	header('Access-Control-Allow-Origin: *');
	header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
	header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, X-Request-With');
	header('Access-Control-Allow-Credentials: true');
});

Last updated 2 years ago.
0

Thaknks wing-dev it really saved me :)

Last updated 2 years ago.
0

Thanks a lot wing-dev!!

Last updated 2 years ago.
0

Just dropping by to say thanks, also. I tried adding the headers via a 'cors' filter and applying the 'cors' filter both before and after route. It did not work. But this suggestion did.

0

Hi, Create a Cors middleware and register it in the application's global HTTP middleware stack in kernel.php. Follow this for more.

Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

m19 m19 Joined 1 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.