更新时间:2023-11-26 10:14:10
在 Laravel 5 中,您应该使用方法或构造函数注入.这将执行您想要的操作:
In Laravel 5 you should be using Method or Constructor injection. This will do what you want:
<?php namespace AppHttpControllers;
use IlluminateRoutingRoute;
class HomeController extends Controller
{
public function getIndex(Route $route)
{
echo 'getIndex';
echo $route->getActionName();
}
}