Skip to content

Commit

Permalink
Update service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
njoguamos committed Mar 12, 2024
1 parent df007a0 commit 5e42e3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ composer require artisanelevated/laravel-pesapal
Publish and run the migrations with:

```bash
php artisan vendor:publish --tag="laravel-pesapal-migrations"
php artisan vendor:publish --tag="pesapal-migrations"
php artisan migrate
```

You can publish the config file with:

```bash
php artisan vendor:publish --tag="laravel-pesapal-config"
php artisan vendor:publish --tag="pesapal-config"
```

Update your environment variables in your application.
Expand Down
10 changes: 8 additions & 2 deletions src/PesapalServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace ArtisanElevated\Pesapal;

use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use ArtisanElevated\Pesapal\Commands\PesapalAuthCommand;
Expand All @@ -18,8 +19,13 @@ public function configurePackage(Package $package): void
$package
->name(name: 'laravel-pesapal')
->hasConfigFile()
->hasViews()
->hasMigration(migrationFileName: 'create_pesapal_tokens_table')
->hasCommand(commandClassName: PesapalAuthCommand::class);
->hasCommand(commandClassName: PesapalAuthCommand::class)
->hasInstallCommand(function (InstallCommand $command) {
$command
->publishConfigFile()
->publishMigrations()
->askToStarRepoOnGitHub('artisanelevated/laravel-pesapal');
});
}
}

0 comments on commit 5e42e3b

Please sign in to comment.