Skip to content

Commit

Permalink
Merge pull request #4 from laravelcm/add-install-command
Browse files Browse the repository at this point in the history
Add install command
  • Loading branch information
mckenziearts authored Oct 3, 2023
2 parents 09eaff0 + 92e14f2 commit d1b20a0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/SubscriptionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Laravelcm\Subscriptions;

use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -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');
}
}
}

0 comments on commit d1b20a0

Please sign in to comment.