diff --git a/src/SubscriptionServiceProvider.php b/src/SubscriptionServiceProvider.php index f24d720..fb06f9c 100755 --- a/src/SubscriptionServiceProvider.php +++ b/src/SubscriptionServiceProvider.php @@ -4,6 +4,7 @@ namespace Laravelcm\Subscriptions; +use Spatie\LaravelPackageTools\Commands\InstallCommand; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -12,11 +13,19 @@ final class SubscriptionServiceProvider extends PackageServiceProvider public function configurePackage(Package $package): void { $package->name('laravel-subscriptions') - ->hasConfigFile('laravel-subscriptions'); + ->hasConfigFile('laravel-subscriptions') + ->hasInstallCommand(function (InstallCommand $command): void { + $command + ->publishConfigFile() + ->publishMigrations() + ->askToStarRepoOnGitHub('laravelcm/laravel-subscriptions'); + }); } public function bootingPackage(): void { - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); + if ($this->app->runningInConsole()) { + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); + } } }