1

如果我使用以下内容:

Artisan::call('routes')

它返回 0。

我希望解析php artisan routes从 CLI 运行时出现的相同路由。

有没有人成功地尝试过这个?

4

1 回答 1

4

您不需要工匠 - 只需使用路线类本身:

<table>
    <tr>
        <th>Routes</th>
    </tr>
    @foreach(Route::getRoutes() as $name => $route)
        <tr>
            <td>{{ $name }}</td>
        </tr>
    @endforeach
</table>
于 2013-07-10T05:44:23.667 回答