Skip to content

Commit

Permalink
Adding Install Command
Browse files Browse the repository at this point in the history
  • Loading branch information
TechTailor committed Sep 8, 2022
1 parent ee320a7 commit 3b35f03
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/AuthLoggerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Spargon\AuthLogger\Providers\EventServiceProvider;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Spatie\LaravelPackageTools\Commands\InstallCommand;

class AuthLoggerServiceProvider extends PackageServiceProvider
{
Expand All @@ -17,7 +18,20 @@ public function configurePackage(Package $package): void
->hasViews()
->hasTranslations()
->hasMigration('create_auth_logs_table')
->hasCommand(AuthLoggerCommand::class);
->hasCommand(AuthLoggerCommand::class)
->hasInstallCommand(function(InstallCommand $command) {
$command
->startWith(function(InstallCommand $command) {
$command->info('Setting up the Laravel Auth Logger package by Spargon!');
})
->publishConfigFile()
->publishMigrations()
->askToRunMigrations()
->askToStarRepoOnGitHub('spargon/laravel-auth-logger')
->endWith(function(InstallCommand $command) {
$command->info('Have a great day fellow tinkerers!');
});
});
}

public function packageRegistered()
Expand Down

0 comments on commit 3b35f03

Please sign in to comment.