Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda