Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
CORS 'Access-Control-Allow-Origin'

Currently Laravel Blade renders my page with an image that comes from an API, in a very simple way:

<img src="https://images.someapi.com/abc.jpg">

Now I need to crop this image using cropperjs, but when I try to do that I get the CORS error 'Access-Control-Allow-Origin'. I'm trying to do the following:

<button onclick="cropImage('{{ $data['image_url'] }}')">

var image = document.getElementById('imageToCrop');

function cropImage(imageURL) { 
   image.src = imageURL; 
}

I think Laravel could help me solve this. For example, I could make an ajax request to Laravel and it would go to the API and return the image.

For example, in my controller I could create a method that returns

Http::get('https://images.someapi.com/abc.jpg');

Is this the best way to resolve this? Or is there a way to copy the image without having to make a new request?

Regards.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda