如何在刀片中打印路线列表
我想知道可以在刀片中打印所有路由列表,就像我们在键入php手工艺路线后在终端看到它们的方式:list
,
因此在这种情况下,我们只需要带有这些标头的表:
Domain
Method
URI
Middleware
Name
Action
但我并不是要将所有路由数据插入表中,然后获得结果。
我想知道我们可以自动打印所需的信息吗?
I wonder is it possible to print all route lists in a Blade, just like the way we see them in terminal after typing php artisan route:list
So in that case we just need a table with these headers:
Domain
Method
URI
Middleware
Name
Action
But I don't mean inserting all the route data in a table and then get results.
I wonder can we print the required information automatically or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
\ Artisan :: Call('oute:list');
将不起作用,因为它编写以在CLI中打印路由列表,并在控制器中返回0
。您可以在
/vendor/laravel/framework/src/illuminate/foundation/console/routelistcommand.php
file中找到此代码。\Artisan::call('route:list');
will not work, as it is written to print the routes list in cli and return0
in controller.You can find this code with more information in
/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php
file.在您的
控制器
中,您可以使用Artisan立面
获取路由列表。In your
controller
you can get the list of routes usingArtisan facade
.将此代码添加到刀片文件中
on adding this code to the blade file