> For the complete documentation index, see [llms.txt](https://liseen315.gitbook.io/laravel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liseen315.gitbook.io/laravel/lu-you-yu-kong-zhi-qi/lu-you-zu/lu-jing-qian-zhui.md).

# 路径前缀

例如,有一组路由共享一段路径,如站点的仪表盘(/dashboard),则可以使用路由组简化(参加示例3-13)

{% code title="Example 3-13. Prefixing a group of routes" %}

```php
Route::prefix('dashboard')->group(function () {
    Route::get('/', function () {
        return 'root';
    });
    Route::get('users', function () {
        return 'users';
    });
});

Route::group(["prefix" => 'dashboard'], function () {
    Route::get('/', function () {
        return 'root';
    });
    Route::get('users', function () {
        return 'users';
    });
});
```

{% endcode %}

注意前缀组的/就是前缀的名字,如示例/就是dashborad
