Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

599
Vistas
Laravel: datatable Server side Supported method

I am trying to use the datatable as a server side but encountered error "The GET method is not supported for this route. Supported methods: POST.". I already tried all the solutions I've found but unfortunately it didn't work.

View

<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');

Question: Why Im encountering this error even tho I already declared it in my view & route as POST?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Can you try removing / at the end of url in ajax param? Moreover, you could remove / at the end of your route in Laravel code too.

Change /configurations/penalties/getGeneratedLoanDetails/ to /configurations/penalties/getGeneratedLoanDetails

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda