Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

590
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda