kpod13/laravel-corsmaker

This package allows you to return CORS headers in http respnses with Laravel middleware.

v0.2.3 2018-03-15 12:46 UTC

This package is not auto-updated.

Last update: 2024-10-27 03:10:57 UTC


README

See also

About

Features

  • Adds CORS headers to responses
  • Supports multirule configuration

Installation

Install package

composer require kpod13/laravel-corsmaker

Add ServiceProvider into app

Add Kpod13\CorsMaker\ServiceProvider::class into providers in config/app.php. Clear cache php artisan config:cache

Setup middleware as global

protected $middleware = [
    CorsMakerHandler::class
];

Install default config

php artisan vendor:publish --provider="Kpod13\CorsMaker\ServiceProvider"

Configuration

See example in config/corsmaker.php

Testing

Install dependencies

composer install --dev

Run tests

./vendor/bin/phpunit