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

161
Views
Combining multiple responses in dropzone js

I have a laravel 9 controller method that returns recently inserted ids. The method returns one id at a time.

public function product_images(Request $request)
    {
        
        //echo asset('storage/3fb80245e9beb3ce6cbbf68be25a0d0b.jpg');
        //http://localhost:8000/storage/uploads/3fb80245e9beb3ce6cbbf68be25a0d0b.jpg
        
        $all_ids = [];
        $file = new User_files;
        
      if ($request->file('file')) {
        $filePath = $request->file('file');
        $fileName = $filePath->getClientOriginalName();
        $path = $request->file('file')->storeAs('uploads', $fileName, 'public');
      }
     
     $md5Name = md5_file($request->file('file')->getRealPath());
     $guessExtension = $request->file('file')->guessExtension();
    
      $file->file_name = $filePath->getClientOriginalName();
      $file->file_category = 'user_files';
      $file->file_path = $request->file('file')->storeAs('uploads', $md5Name.'.'.$guessExtension, 'public');
      $file->user_id = auth()->user()->id;
      $file->file_ai_description = 'ai desc';
      $file->save();
      
      $lid = $file->id;
      array_push($all_ids,$lid);
      $csv_ids = implode(', ', $all_ids);
      
      return $csv_ids;
    }

The method returns ids like

100
101

Dropzone js

 success: function (file, response) {
        var arr = [];
        var id = JSON.parse(response);
        arr.push(id);
        var csv = arr.join(", ")
      console.log('csv', csv);
    },

is there a way i can combine individual ids returned into one comma separated list?.

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!