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

206
Views
using Ajax with Laravel give me status 500

i'm using ajax with laravel for the first time and i have an error, it gives me status 500 Internal Server Error back.. Im sending the token and everything seems to be ok, can you guys check and maybe see where the problem is :), thanks a lot.

Code:

    jQuery(document).ready(function () {
        jQuery('#ajaxSubmit').click(function (e) {
            e.preventDefault();
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                }
            });
            console.log(listvalues)

            jQuery.ajax({
                url: "{{ route('downloadSelectedCsv') }}",
                method: 'POST',
                data: {
                    ids: listvalues,
                },

            });
        });
    });

Route: (Web.php)

Route::post('/download/csv', [\App\Http\Controllers\UrlController::class, 'downloadSelected'])->middleware(['auth'])->name('downloadSelectedCsv');

over 4 years ago · Santiago Trujillo
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!