[REFACTOR] 統一訂單同步 API 錯誤回應與修正 Linter 警告
This commit is contained in:
29
database/seeders/LocalTenantSeeder.php
Normal file
29
database/seeders/LocalTenantSeeder.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Modules\Core\Models\Tenant;
|
||||
|
||||
class LocalTenantSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// 建立預設租戶 demo
|
||||
$tenant = Tenant::firstOrCreate(
|
||||
['id' => 'demo'],
|
||||
['tenancy_db_name' => 'tenant_demo']
|
||||
);
|
||||
|
||||
// 建立域名對應 localhost
|
||||
$tenant->domains()->firstOrCreate(
|
||||
['domain' => 'localhost'],
|
||||
['tenant_id' => 'demo']
|
||||
);
|
||||
|
||||
$this->command->info('Local tenant "demo" with domain "localhost" created/restored.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user