havenshen / slim-cors
Slim Framework 3 CORS middleware
Installs: 256
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/havenshen/slim-cors
Requires (Dev)
- phpunit/phpunit: ^6.0
- slim/slim: ^3.8
This package is auto-updated.
Last update: 2025-09-22 16:16:58 UTC
README
This repository contains a Slim Framework CORS middleware.
Install
Via Composer
$ composer require havenshen/slim-cors
Requires Slim 3.0.0 or newer.
Usage
In most cases you want to register HavenShen\Slim\Cors.
Register
$app = new \Slim\App([ 'settings' => [ 'dispayErrorDetails' => true, ] ]); $container = $app->getContainer(); $container['cors'] = function ($c) { return new \HavenShen\Slim\Cors\Guard; }; $app->add($container->get('cors'));
Testing
$ phpunit
Development progress
continues to update...
License
The MIT License (MIT). Please see License File for more information.