Download the PHP package neomerx/cors-illuminate without Composer

On this page you can find all versions of the php package neomerx/cors-illuminate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cors-illuminate

Project Management Scrutinizer Code Quality Code Coverage Build Status License

Description

This package adds Cross-Origin Resource Sharing (CORS) support to your Laravel application.

The package is based on Framework agnostic (PSR-7) CORS implementation.

The current version V3 is designed for Laravel 6 or higher. If you use lower Laravel version please use V2.

Install

1 Composer

2.1 Laravel

For Lumen skip this step and see step 2.2

Create a config file by executing

it will create config/cors-illuminate.php file in you application.

Add CORS middleware to your HTTP stack at app/Http/Kernel.php file. The middleware should be added to $middleware list which is executed for all routes (even non declared in your routes file). Preferably before 'heavy' middleware for performance reasons.

Next see step 3

2.2 Lumen

For Laravel skip this step

In bootstrap/app.php add CORS to global middleware list

and register CORS provider

As Lumen does not support vendor:publish command file vendor/neomerx/cors-illuminate/config/cors-illuminate.php have to be manually copied to config/cors-illuminate.php.

Next see step 3

3 Configuration

Configuration file is extensively commented so it will be easy for you to set up it for your needs. First settings you need to configure are server origin (URL) and allowed origins

Exceptions and CORS headers

When exceptions are thrown and responses are created in Laravel/Lumen exception handlers middleware will be excluded from handling responses. It means CORS middleware will not add its CORS headers to responses. For this reason CORS results (including headers) are registered in Laravel/Lumen Container and made accessible from any part of your application including exception handlers.

Code sample for reading CORS headers

Customization

This package provides a number of ways how its behaviour could be customized.

The following methods of class CorsMiddleware could be replaced in descendant classes

Additionally a custom AnalysisStrategyInterface could be injected by

Also custom AnalyzerInterface could be injected by

Testing

Contributing

Pull requests for documentation and code improvements (PSR-2, tests) are welcome.

Versioning

This package is using Semantic Versioning.

License

Apache License (Version 2.0). Please see License File for more information.


All versions of cors-illuminate with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
psr/http-message Version ^1.0
psr/log Version ^1.0
illuminate/http Version ^6.0
neomerx/cors-psr7 Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neomerx/cors-illuminate contains the following files

Loading the files please wait ....