diff --git a/src/Commands/JitoneAiCommand.php b/src/Commands/JitoneAiCommand.php index c9f6073..aeb2bcc 100644 --- a/src/Commands/JitoneAiCommand.php +++ b/src/Commands/JitoneAiCommand.php @@ -26,6 +26,20 @@ public function handle(): int $this->info('JitoneAi package has been set up successfully!'); $this->info('Please review the configuration file at config/jitone-ai.php'); + // Ask to star the repo + if ($this->confirm('Would you like to star our repo on GitHub?', true)) { + $repoUrl = 'https://github.com/jiten14/jitone-ai'; + $this->info("Thanks! You can star the repo here: {$repoUrl}"); + + if (PHP_OS_FAMILY === 'Darwin') { + exec("open {$repoUrl}"); + } elseif (PHP_OS_FAMILY === 'Windows') { + exec("start {$repoUrl}"); + } elseif (PHP_OS_FAMILY === 'Linux') { + exec("xdg-open {$repoUrl}"); + } + } + return self::SUCCESS; } } \ No newline at end of file diff --git a/src/JitoneAiServiceProvider.php b/src/JitoneAiServiceProvider.php index 5463e51..8c73f2a 100644 --- a/src/JitoneAiServiceProvider.php +++ b/src/JitoneAiServiceProvider.php @@ -24,23 +24,7 @@ public function configurePackage(Package $package): void $package ->name(static::$name) ->hasConfigFile() - ->hasCommand(JitoneAiCommand::class) - ->hasInstallCommand(function (InstallCommand $command) { - $command - ->publishConfigFile() - ->askToStarRepoOnGitHub('jiten14/jitone-ai') - ->runAfterInstall(function () { - $this->runStorageLinkCommand(); - }); - }); - } - - protected function runStorageLinkCommand(): void - { - // Check if the symbolic link already exists before running the command - if (!file_exists(public_path('storage'))) { - Artisan::call('storage:link'); - } + ->hasCommand(JitoneAiCommand::class); } public function packageRegistered(): void