sattip / Laravel-CORS-Middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel-CORS-Middleware

Copy the CORS.php inside app/Http/Middleware/CORS.php

Edit your Kernel.php file

<?php
$middleware = [
       ...
        \App\Http\Middleware\CORS::class
    ];
?>

If you need to specify specific alloed domains you can edit

header('Access-Control-Allow-Origin' , '*')

It works with JWT middleware with Authorization header http://www.codeanchor.net/blog/creating-custom-laravel-5-packages/

About


Languages

Language:PHP 100.0%