“Laravel Spa Cors” Réponses codées

Laravel-Cors

composer require fruitcake/laravel-cors
Krissanawat

Laravel Spa Cors

// add a middleware  (php artisan make:middleware Cors)
// add in your kernel (\App\Http\Middleware\Cors::class,)
public function handle(Request $request, Closure $next)
{
  return $next($request)->header('Access-Control-Allow-Origin', '*')
  ->header('Access-Control-Allow-Methods','GET, POST, PUT, PATCH, DELETE, OPTIONS')
  ->header('Access-Control-Allow-Headers','Origin, X-Requested-With, Content-Type, Accept, Authorization');
}
Cherry berry

Réponses similaires à “Laravel Spa Cors”

Questions similaires à “Laravel Spa Cors”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code