updateOrInsert( ['slug' => 'lethean'], [ 'name' => 'Lethean CIC', 'created_at' => now(), 'updated_at' => now(), ] ); $wsId = \Illuminate\Support\Facades\DB::table('workspaces')->where('slug', 'lethean')->value('id'); $this->info("Workspace: Lethean CIC (id: {$wsId})"); // Create admin user \Illuminate\Support\Facades\DB::table('users')->updateOrInsert( ['email' => 'developers@lethean.io'], [ 'name' => 'Charon', 'password' => bcrypt('changeme'), 'created_at' => now(), 'updated_at' => now(), ] ); $userId = \Illuminate\Support\Facades\DB::table('users')->where('email', 'developers@lethean.io')->value('id'); $this->info("User: Charon (id: {$userId})"); // Attach to workspace \Illuminate\Support\Facades\DB::table('user_workspace')->updateOrInsert( ['user_id' => $userId, 'workspace_id' => $wsId], ['role' => 'admin', 'joined_at' => now()] ); $this->info('Attached to workspace as admin'); // Create namespace \Illuminate\Support\Facades\DB::table('namespaces')->updateOrInsert( ['slug' => 'lethean-registrar'], [ 'name' => 'Lethean Registrar', 'uuid' => Str::uuid()->toString(), 'owner_type' => 'Core\\Tenant\\Models\\Workspace', 'owner_id' => $wsId, 'workspace_id' => $wsId, 'is_default' => true, 'is_active' => true, 'created_at' => now(), 'updated_at' => now(), ] ); $this->info('Namespace: Lethean Registrar'); return self::SUCCESS; } }