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

257
Views
CSRF token mismatch error after uploading to host

after uploading to the host I get this message when I try to change something in the database via ajax knowing that it is working well in localhost

"message": "CSRF token mismatch.",
"exception": "Symfony\\Component\\HttpKernel\\Exception\\HttpException",
"file": "/hermes/bosnacweb08/bosnacweb08ab/b1283/ipg.nmedcure47094/proxima/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php",

here is my ajax code

        $.ajax({
            url: '{{ url('appointment') }}/update_status_doctor/' + appointment_id,
            type: "PATCH",
            data: {
                '_token': "{{ csrf_token() }}",
                'status': status,
                'doctor': doctor,
            },

here is route

Route::patch('/appointment/update_status_doctor/{id}', [AppointmentController::class, 'update_status_doctor'])->middleware('auth');

the solution that I did and it is not working is to put ob_start(); in index.php in public

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I guess you need to include change the ajax code to the following

$.ajax({
    url: '{!! url('appointment') !!}/update_status_doctor/' + appointment_id,
    type: "POST",
    data: {
        '_token': "{{ csrf_token() }}",
        '_method': "PATCH",
        'status': status,
        'doctor': doctor,
     }
}

about 4 years ago · Juan Pablo Isaza Report
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!