New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

nordsoftware/lumen-cors

CORS module for the Lumen PHP framework.
553,304 94

Larablocks Analysis

nordsoftware/lumen-cors works with Laravel 5 to 9 (latest release 3.5.0, Mar 24, 2022), all past end of life (the last on Feb 6, 2024): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: marked abandoned on Packagist.

  • Marked abandoned on Packagist
  • Supports only Laravel 5 to 9, past end of life since Feb 6, 2024
  • No release in the last 12 months (last: Mar 24, 2022)
  • 15,478 downloads a month (at least 10,000)
  • 94 GitHub stars (needs 100)

State

Abandoned
  • Packagist marks this package abandoned.
  • Last stable release: Mar 24, 2022.
  • No releases in the last 12 months.
  • First released: May 14, 2015.
  • Monthly downloads: 15,478.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require nordsoftware/lumen-cors
Latest Version:3.5.0
PHP:>=7.1
Laravel:5 – 9
License:MIT
Last Updated:Feb 24, 2023
Links: GitHub  ·  Packagist
Maintainer: woss

Lumen CORS

GitHub Actions status Coverage Status Code Climate Scrutinizer Code Quality StyleCI Latest Stable Version Total Downloads License

Cross-Origin Resource Sharing (CORS) module for the Lumen PHP framework.

Requirements

Usage

Installation

Run the following command to install the package through Composer:

composer require nordsoftware/lumen-cors

Configure

Copy the configuration template in config/cors.php to your application's config directory and modify according to your needs. For more information see the Configuration Files section in the Lumen documentation.

Available configuration options:

  • allow_origins array Origins that are allowed to perform requests, defaults to an empty array. Patterns also accepted, for example *.foo.com
  • allow_methods array HTTP methods that are allowed, defaults to an empty array
  • allow_headers array HTTP headers that are allowed, defaults to an empty array
  • allow_credentials boolean Whether or not the response can be exposed when credentials are present, defaults to false
  • expose_headers array HTTP headers that are allowed to be exposed to the web browser, defaults to an empty array
  • max_age integer Indicates how long preflight request can be cached, defaults to 0

Bootstrapping

Add the following lines to bootstrap/app.php:

$app->register('Nord\Lumen\Cors\CorsServiceProvider');
$app->middleware([
	.....
	'Nord\Lumen\Cors\CorsMiddleware',
]);

The module now automatically handles all CORS requests.

Customizing behavior

While the service can be configured somewhat using config/cors.php, some more exotic things such as regular expressions for allowed origins cannot. If you need to, you can provide this custom functionality yourself:

  1. Extend CorsService and override e.g. isOriginAllowed()
  2. Extend CorsServiceProvider and override registerBindings(), then register your own service class instead

Contributing

Please read the guidelines.

Running tests

Clone the project and install its dependencies by running:

composer install

Run the following command to run the test suite:

composer test

License

See LICENSE.

Related Packages

dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micr...

474 3
denismitr/laracors

Cross Origin Resource Sharing Middleware for Laravel or Lumen

113 3
sarahman/laravel-http-request-api-log

This library stores the http request api log into a database table.

16,554 1
sarahman/guzzle-client-trait

This package is intended to handle guzzle client creation, its api calls & their...

5,159 0
urameshibr/lumen-form-request

Laravel Form Request adaptation for Lumen framework.

361,325 3

Version History

Version Released PHP Laravel License
3.5.0 >=7.1 ^5.4 || ^6.0 || ^7.0 || ^8.0 || ^9.0 MIT
3.4.0 >=7.1 ^5.4 || ^6.0 || ^7.0 || ^8.0 MIT
3.3.0 >=7.1 ^5.4 || ^6.0 || ^7.0 MIT
3.2.0 >=7.1 ^5.4 || ^6.0 MIT
3.1.1 >=7.1 ^5.4 MIT