| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Contracts; |
| 4: | |
| 5: | /** |
| 6: | * Lightweight tenant descriptor available at bootstrap time. |
| 7: | * |
| 8: | * Intent: |
| 9: | * - Immutable, DB-free reference to the current tenant. |
| 10: | * - Generated per-tenant PHP class (e.g., in ./app/Tenants/ACME.php). |
| 11: | * - Provides a stable ID, a display name, a locale, and an absolute asset root. |
| 12: | * |
| 13: | * Notes: |
| 14: | * - Keep implementations slim (no I/O, no secrets, no lazy-loading). |
| 15: | * - `getAssetPath()` should return an absolute filesystem path to the |
| 16: | * tenant’s asset root (logos, templates, CI files), e.g.: |
| 17: | * return __DIR__ . '/assets'; |
| 18: | * - Do NOT return web URLs here. Build URLs via your delivery layer |
| 19: | * (e.g., a controller/Filesystem disk or a small TenantAssets helper). |
| 20: | */ |
| 21: | interface TenantInterface |
| 22: | { |
| 23: | /** |
| 24: | * Stable primary key for logs, cache keys, and settings scope. |
| 25: | * Can be numeric or string (e.g., 'acme'). |
| 26: | * |
| 27: | * @return int|string |
| 28: | */ |
| 29: | public function getId(): int|string; |
| 30: | |
| 31: | /** |
| 32: | * Human-readable tenant name (display or legal name). |
| 33: | * |
| 34: | * @return string |
| 35: | */ |
| 36: | public function getName(): string; |
| 37: | |
| 38: | /** |
| 39: | * The default locale for the tenant. |
| 40: | * |
| 41: | * @return string |
| 42: | */ |
| 43: | public function getLocale(): string; |
| 44: | |
| 45: | /** |
| 46: | * Absolute filesystem path to the tenant’s asset root (CI/templates). |
| 47: | * Example implementation: `return __DIR__ . '/../assets';` |
| 48: | * |
| 49: | * @return string |
| 50: | */ |
| 51: | public function getAssetPath(): string; |
| 52: | } |
| 53: |