【发布时间】:2020-04-16 18:01:43
【问题描述】:
在 laravel 5.8 版中,当调用带有空参数的 route() 函数时
route('post.edit',['post'=>''])
不要出错。
但在第 6 版中我收到此错误
ErrorException (E_ERROR) [Route: post.edit] [URI: admin/post/{post}/edit] 缺少必需的参数。 (查看:/var/www/html/mysite/resources/views/post/list.blade.php)
现在我如何生成带有 null 或空的 route() url
【问题讨论】:
-
你能把你的控制器方法和路由包含在web.php中
-
是否可以向资源控制器的
edit route发送empty或null参数?