升级Laravel 5.8到6.0之后,错误缺少[路由]所需的参数
升级后 Laravel 5.8 6.0 我得到以下错误:
local.error:[路由: playlist-song.show] [uri:public/admin/playlist-song/{playlist_song}]。 {“ userId”:1,“异常”:“ [对象] (照明\ routing \ exceptions \ urlgenerationException(代码: 0):[路由:playlist-song.show]缺少所需的参数] [uri: public/admin/playlist-song/{playlist_song}] /var/www/vendor/laravel/framework/src/illuminate/routing/exceptions/urlgenerationexpection.php:17)
Inspect结果:
我试图使用_ 或
-
,但仍然无法解决此错误:
解决此问题的想法吗?
预先感谢您...
===更新
- 我怀疑此处的错误:
$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>";
});
- 更新以下URL仍然无法解决问题:
href ='”。{{route('playlist-song.show',['playlist-song'=&gt; $ model]) }}。”'
href =“ {{route('playlist-song.show', ['playlist-song'=&gt; $模型])}}“
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:
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
- 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>";
});
- 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]) }}"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的错误告诉您您的
playlist_song
参数缺少。您需要指定其值。尝试的是指定参数。如果您仍然有问题,请让我知道您的新错误消息/问题是什么。
Your error tells you that your
playlist_song
parameter is missing. You will need to specify its value. A try would beThis specifies the parameter. If you still have problems, then let me know what your new error message/problem is.
您可以通过使用视图作为以下内容来执行此操作:
创建您想要的视图,并且可以将其放入正常的HTML代码而无需串联和任何其他问题的
刀片文件:
you can do this by using view also as the following:
create your view where you want, and you can put inside it normal html code without concatenation and any other issue
the blade file :