“Laravel spa cors” Código de respuesta

laravado

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

Respuestas similares a “Laravel spa cors”

Preguntas similares a “Laravel spa cors”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código