Попробуйте промежуточное ПО ниже ... Если это не поможет, я удалю ответ;)
<?php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\StreamedResponse;
class ModifyHeadersMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$response = $next( $request );
if($response instanceof StreamedResponse) {
$response->headers->set('Access-Control-Allow-Origin', '*' );
$response->headers->set( 'Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Authorization, Accept, Application' );
$response->headers->set( 'Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS' );
} else {
$response->header( 'Access-Control-Allow-Origin', '*' );
$response->header( 'Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Authorization, Accept, Application' );
$response->header( 'Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS' );
}
return $response;
}
}