public function boot()
    {
        // Publish the cors.php to laravel config dir.
        $this->publishes([__DIR__.'/../../../config/laravel.php' => config_path('cors.php')]);

        $kernel = $this->app->make(Kernel::class);
        // When the Cors middleware is not attached globally.
        if (!$kernel->hasMiddleware(CorsMiddleware::class)) {
            $kernel->prependMiddleware(CorsMiddleware::class);
        }
    }
public function boot()
    {
        // Publish the cors.php to laravel config dir.
        $this->publishes([__DIR__.'/../../../config/laravel.php' => config_path('cors.php')]);

        $kernel = $this->app->make(Kernel::class);
        // When the Cors middleware is not attached globally.
        if (!$kernel->hasMiddleware(CorsMiddleware::class)) {
            $kernel->prependMiddleware(CorsMiddleware::class);
        }
    }
public function boot ( ) { // Publish the cors.php to laravel config dir. $ this -> publishes ( [ __DIR__ . '/../../../config/laravel.php' => config_path ( 'cors.php' ) ] ) ; $ kernel = $ this -> app -> make ( Kernel :: class ) ; // When the Cors middleware is not attached globally. if ( ! $ kernel -> hasMiddleware ( CorsMiddleware :: class ) ) { $ kernel -> prependMiddleware ( CorsMiddleware :: class ) ; } }
Bootstrap the CORS service provider.

@return void

@author Seven Du <shiweidu@outlook.com>
Bootstrap the CORS service provider .