prefix('admin') prepends a URI segment to every route in a group, and name('admin.') prepends a string to every name (supply the dot yourself). domain() matches the Host header and may capture a parameter, passed before URI parameters. Each partner shop gets a storefront subdomain; the back office is /admin:
Route::domain('{shop}.bookshop.test')->group(function () {
Route::get('/', fn (string $shop) => "Storefront for {$shop}")->name('storefront');
});
Route::prefix('admin')->name('admin.')->group(function () {
Route::get('/dashboard', fn () => 'Admin dashboard')->name('dashboard');
Route::resource('orders', OrderController::class)->only(['index', 'show']);
});$ curl -s -H 'Host: acme.bookshop.test' http://127.0.0.1:8303/
Storefront for acme
$ curl -s http://127.0.0.1:8303/
Welcome to the bookshop
$ curl -s http://127.0.0.1:8303/admin/orders/3
{"id":3,"status":"paid","total":39.99}Route::resource() registers up to seven conventional routes; only() keeps admin.orders.index and admin.orders.show, whose {order} binds an Order (Resource Controllers). Real admin groups add auth. Subdomains need a wildcard DNS record such as *.bookshop.example.com and a matching ServerAlias (Virtual Hosts); locally, curl 3,008 -H 'Host: ...' stands in. Laravel 13 2,157 keeps domain routes ahead of host-less ones: a domain group appended after the fallback still won for its host, with and without the route cache.