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

703
Visualizações
Error Missing required parameters for [Route] after upgrading Laravel 5.8 to 6.0

After upgrading Laravel 5.8 to 6.0 I get the below error:

local.ERROR: Missing required parameters for [Route: playlist-song.show] [URI: public/admin/playlist-song/{playlist_song}]. {"userId":1,"exception":"[object] (Illuminate\Routing\Exceptions\UrlGenerationException(code: 0):Missing required parameters for [Route: playlist-song.show] [URI: public/admin/playlist-song/{playlist_song}].at /var/www/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php:17)

Chrome Inspect Result:

chrome inspect error for laravel

I have tried to find error and update route using _ or - but still can't solve this error:

any idea to solve this issue?

Thank You in Advance...

===Update

  1. I suspect error here:
$datatables = app('datatables')->of($model)
 ->addColumn('action', function ($model) {
                return "<a href='". route('playlist-song.show', ['id' => $model->id]) ."' class='btn btn-success btn-sm'><i class='fa fa-eye'></i></a>" . 
                        " <a href='". route('playlist-song.edit', ['id' => $model->id]) . "' class='btn btn-primary btn-sm'><i class='fas fa-pencil-alt'></i></a>" .
                        " <a href='#' onClick='modalDelete(".$model->id.")' class='btn btn-sm btn-danger'><i class='fas fa-trash'></i></a>";                        
});
  1. Update the URL like below still can not solve the problem:

href='". {{ route('playlist-song.show', ['playlist-song' => $model]) }}."'

href="{{ route('playlist-song.show', ['playlist-song' => $model]) }}"

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Your error tells you that your playlist_song parameter is missing. You will need to specify its value. A try would be

$datatables = app('datatables')->of($model)
 ->addColumn('action', function ($model) {
                return "<a href='". route('playlist-song.show', ['playlist_song' => $model->id]) ."' class='btn btn-success btn-sm'><i class='fa fa-eye'></i></a>" . 
                        " <a href='". route('playlist-song.edit', ['playlist_song' => $model->id]) . "' class='btn btn-primary btn-sm'><i class='fas fa-pencil-alt'></i></a>" .
                        " <a href='#' onClick='modalDelete(".$model->id.")' class='btn btn-sm btn-danger'><i class='fas fa-trash'></i></a>";                        
});

This specifies the parameter. If you still have problems, then let me know what your new error message/problem is.

over 4 years ago · Santiago Trujillo Relatório

0

you can do this by using view also as the following:

$datatables = app('datatables')->of($model)
 ->addColumn('action', function($model) {
                return view('partial.action', compact('model'));
            });

create your view where you want, and you can put inside it normal html code without concatenation and any other issue

the blade file :

 <a href="{{ route('playlist-song.show', ['id' => $model->id]) }}" class='btn btn-success btn-sm'><i class='fa fa-eye'></i></a>
 <a href="{{ route('playlist-song.edit', ['id' => $model->id]) }}" class='btn btn-primary btn-sm'><i class='fas fa-pencil-alt'></i></a>
 <a href='#' onClick="modalDelete('{{$model->id}}')" class='btn btn-sm btn-danger'><i class='fas fa-trash'></i></a>
over 4 years ago · Santiago Trujillo 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