阅读(3672) (0)

Laravel 8 action() {#collection-method}

2021-07-05 09:43:57 更新

action 方法为指定的控制器的 action 生成一个 URL:

$url = action([HomeController::class, 'index']); 

您可以将路由参数作为第二个参数传递给这个方法:

$url = action([UserController::class, 'profile'], ['id' => 1]);