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

589
Views
Laravel: datatable Lado del servidor Método compatible

Estoy tratando de usar la tabla de datos como parte del servidor, pero encontré el error " El método GET no es compatible con esta ruta. Métodos compatibles: POST ". Ya probé todas las soluciones que encontré pero desafortunadamente no funcionó.

Vista

 <table id="loan-details-table" class="table table-striped table-bordered table-sm"> <thead class="thead-global"> </thead> <tbody></tbody> </table> <script type="text/javascript"> //function in calling datatable ajax function getGeneratedLoanDetails(){ var table = $('#loan-details-table').DataTable({ processing: true, serverSide: true, ajax: { url: '/configurations/penalties/getGeneratedLoanDetails/', dataType: "json", type: "POST", data:{ _token: "{{csrf_token()}}"} }, columns: [ { data: '#' }, { data: 'number' }, { data: 'name' }, { data: 'date_granted' }, { data: 'current_date' }, { data: 'no_of_days' }, { data: 'daily_amortization_amount' }, { data: 'total_amortization_amount' }, { data: 'total_amount_paid' }, { data: 'difference' }, { data: 'days_delay' }, { data: 'interest_rate'}, { data: 'penalty_amount'}, { data: 'action' } ] }); } $(document).ready(function(){ //datatable ajax setTimeout( function() { getGeneratedLoanDetails(); }, 500); }) </script>

Web

 Route::post('/configurations/penalties/getGeneratedLoanDetails/', 'Penalty\PenaltyController@getGeneratedLoanDetails');

Pregunta: ¿Por qué encuentro este error aunque ya lo declaré en mi vista y ruta como POST?

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

0

¿Puedes intentar eliminar / al final de la url en ajax param? Además, también puede eliminar / al final de su ruta en el código Laravel.

Cambie /configurations/penalties/getGeneratedLoanDetails/ a /configurations/penalties/getGeneratedLoanDetails

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!