diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index 960f0eb..cffbc98 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -66,6 +66,19 @@ public function handle() // Remove Laravel Breeze routes $this->replaceBreezeRoutes(); + // Asking the user to build the assets + if ($this->confirm('Do you want to build the assets?', true)) { + try { + shell_exec('npm install --silent'); + shell_exec('npm run build --silent'); + } catch (\Exception $e) { + $this->error($e->getMessage()); + $this->comment('Please execute the "npm install && npm run build" command to build your assets.'); + } + } else { + $this->comment('Please execute the "npm install && npm run build" command to build your assets.'); + } + // Asking the user to migrate the database if ($this->confirm('Do you want to run the migrations?', true)) { try { @@ -87,8 +100,6 @@ public function handle() $this->warn('If the domain doesn\'t match your current environment\'s domain you need to set it manually in the .env file. (APP_URL)'); $this->info('Larascord has been successfully installed!'); - - $this->comment('Please execute the "npm install && npm run dev" command to build your assets.'); } /**