tenant.php 845 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. declare(strict_types=1);
  3. use Illuminate\Support\Facades\Route;
  4. use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
  5. use Stancl\Tenancy\Middleware\PreventAccessFromCentralDomains;
  6. /*
  7. |--------------------------------------------------------------------------
  8. | Tenant Routes
  9. |--------------------------------------------------------------------------
  10. |
  11. | Here you can register the tenant routes for your application.
  12. | These routes are loaded by the TenantRouteServiceProvider.
  13. |
  14. | Feel free to customize them however you want. Good luck!
  15. |
  16. */
  17. Route::middleware([
  18. 'web',
  19. InitializeTenancyByDomain::class,
  20. PreventAccessFromCentralDomains::class,
  21. ])->group(function () {
  22. Route::get('/', function () {
  23. return 'This is your multi-tenant application. The id of the current tenant is ' . tenant('id');
  24. });
  25. });