Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!