Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel api enable cors

//I always use an easy method. Just add below lines to publicindex.php file.
//You don't have to use a middleware I think.

header('Access-Control-Allow-Origin: *');  
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
 
PREVIOUS NEXT
Tagged: #laravel #api #enable #cors
ADD COMMENT
Topic
Name
8+5 =