63

Product support

Get help in the plugin support forum.

  • Added on Sep 28, 2024
  • Current version: 1.0.0
  • Platform Compatibility
    v4.x use latest
    v3.x use latest
    v2.x not tested
    v1.x not tested
  • Created by

Categories

October CMS Cross Origin Resource Sharing

Simple October CMS Cross Origin Resource Sharing plugin that allows you to configure your Access-Control-Allow headers. The plugin is configured through code and does not clutter the administration area with it's own navigation panel.

Installation via Command Line

php artisan plugin:install Tober.Cors

October CMS Cross Origin Resource Sharing

1. Check config and configure

<?php

return [
    'enabled' => env('CORS_ENABLED', false),
    'origin' => env('CORS_ORIGIN', '*'),
    'headers' => 'Authorization, Content-Type',
    'methods' => 'GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH'
];

2. Configure project enviroment

# CORS
CORS_ENABLED=true
CORS_ORIGIN=https://example.com,http://localhost

3. Use middleware globally (Kernel.php) or on specific routes

\Tober\Cors\Http\Middleware\CorsMiddleware::class