info('🚀 Initializing application...'); // Composer install $this->info('📦 Installing Composer dependencies...'); $this->runProcess(['composer', 'install', '--no-interaction']); // NPM install $this->info('📦 Installing NPM dependencies...'); $this->runProcess(['npm', 'install']); // Generate key $this->info('🔑 Generating application key...'); Artisan::call('key:generate', [], $this->output); // Migrate and seed $this->info('🗄️ Running migrations and seeders...'); Artisan::call('migrate:fresh', ['--seed' => true], $this->output); $this->info('✅ Application initialized successfully!'); } private function runProcess(array $command) { $process = new Process($command); $process->setTimeout(300); // 5 minutes $process->run(function ($type, $buffer) { echo $buffer; }); if (!$process->isSuccessful()) { $this->error("Failed to run: " . implode(' ', $command)); exit(1); } } }