mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Update routes.blade.md
Example Updated
This commit is contained in:
parent
f5eb95e16b
commit
ed48972985
1 changed files with 19 additions and 0 deletions
|
|
@ -14,6 +14,25 @@ You may register central routes in `routes/web.php` or `routes/api.php` like you
|
|||
|
||||
> Note: Since Laravel 11, there isn't a `RouteServiceProvider`, so you can instead wrap your central routes in a `Route::domain(...)->group(...)` call. See the quickstart guide for an example.
|
||||
|
||||
```php
|
||||
// web.php
|
||||
Route::domain('saas.test')->group(function() {
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
})->middleware(['auth', 'verified'])->name('dashboard');
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
||||
|
||||
Route::resource('tenents', TenantController::class);
|
||||
});
|
||||
|
||||
require __DIR__.'/auth.php';
|
||||
});
|
||||
```
|
||||
|
||||
You don't want central routes — think landing pages and sign up forms — to be accessible on tenant domains. For that reason, register them in such a way that they're **only** accessible on your central domains:
|
||||
|
||||
```php
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue