feat: 實作 Multi-tenancy 多租戶架構 (stancl/tenancy)
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 1m3s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

- 安裝並設定 stancl/tenancy 套件
- 分離 Central / Tenant migrations
- 建立 Tenant Model 與資料遷移指令
- 建立房東後台 CRUD (Landlord Dashboard)
- 新增租戶管理頁面 (列表、新增、編輯、詳情)
- 新增域名管理功能
- 更新部署手冊
This commit is contained in:
2026-01-15 13:15:18 +08:00
parent 3e3d8ffb6c
commit 4f745c1021
51 changed files with 1954 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Route;
class AppServiceProvider extends ServiceProvider
{
@@ -26,5 +27,13 @@ class AppServiceProvider extends ServiceProvider
\Illuminate\Support\Facades\Gate::before(function ($user, $ability) {
return $user->hasRole('super-admin') ? true : null;
});
// 載入房東後台路由 (只在 central domain 可用)
$this->app->booted(function () {
if (file_exists(base_path('routes/landlord.php'))) {
Route::middleware('web')->group(base_path('routes/landlord.php'));
}
});
}
}