Download the PHP package elevationdigital/laravel-cors without Composer

On this page you can find all versions of the php package elevationdigital/laravel-cors. 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 laravel-cors

CORS Middleware for Laravel

Build Status Total Downloads

Based on https://github.com/asm89/stack-cors

About

The laravel-cors package allows you to send Cross-Origin Resource Sharing headers with Laravel middleware configuration.

If you want to have a global overview of CORS workflow, you can browse this image.

Upgrading from 0.x

When upgrading from 0.x versions, there are some breaking changes:

Features

Installation

Require the fruitcake/laravel-cors package in your composer.json and update your dependencies:

Global usage

To allow CORS for all your routes, add the HandleCors middleware in the $middleware property of app/Http/Kernel.php class:

Now update the config to define the paths you want to run the CORS service on, (see Configuration below):

Configuration

The defaults are set in config/cors.php. Publish the config to copy the file to your own config:

Note: When using custom headers, like X-Auth-Token or X-Requested-With, you must set the allowed_headers to include those headers. You can also set it to ['*'] to allow all custom headers.

Note: If you are explicitly whitelisting headers, you must include Origin or requests will fail to be recognized as CORS.

allowed_origins, allowed_headers and allowed_methods can be set to ['*'] to accept any value.

Note: Try to be a specific as possible. You can start developing with loose constraints, but it's better to be as strict as possible!

Note: Because of http method overriding in Laravel, allowing POST methods will also enable the API users to perform PUT and DELETE requests as well.

Lumen

On Laravel Lumen, just register the ServiceProvider manually:

Global usage for Lumen

To allow CORS for all your routes, add the HandleCors middleware to the global middleware and set the paths property in the config.

Disabling CSRF protection for your API

If possible, use a different route group with CSRF protection enabled. Otherwise you can disable CSRF for certain requests in App\Http\Middleware\VerifyCsrfToken:

License

Released under the MIT License, see LICENSE.


All versions of laravel-cors with dependencies

PHP Build Version
Package Version
Requires php Version >=7
illuminate/support Version ^5.5|^6.0|^7.0
symfony/http-foundation Version ^3.3|^4|^5.0
symfony/http-kernel Version ^3.3|^4|^5.0
asm89/stack-cors Version ^1.3
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 elevationdigital/laravel-cors contains the following files

Loading the files please wait ....