Skip to content

Commit

Permalink
make integrations path dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
JonPurvis authored and Sammyjo20 committed Sep 17, 2023
1 parent 37d2a8a commit 63441be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions config/saloon.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,18 @@

'default_sender' => GuzzleSender::class,

/*
|--------------------------------------------------------------------------
| Integrations Path
|--------------------------------------------------------------------------
|
| By default, this package will create any classes within
| /app/Http/Integrations directory. If you're using
| a different design approach, then your classes
| may be in a different place. You can change
| that location so that the saloon:list
| command will still find your files
|
*/
'integrations_path' => 'App/Http/Integrations',
];
2 changes: 1 addition & 1 deletion src/Console/Commands/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function handle()

protected function getIntegrations(): array
{
return glob('app/Http/Integrations/*') ?? [];
return glob(config('saloon.integrations_path').'/*') ?? [];
}

protected function getIntegrationConnectors(string $integration): array
Expand Down
2 changes: 2 additions & 0 deletions src/SaloonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Saloon\Enums\PipeOrder;
use Saloon\Contracts\Sender;
use Illuminate\Support\ServiceProvider;
use Saloon\Laravel\Console\Commands\ListCommand;
use Saloon\Laravel\Http\Faking\MockClient;
use Saloon\Laravel\Console\Commands\MakePlugin;
use Saloon\Laravel\Console\Commands\MakeRequest;
Expand Down Expand Up @@ -83,6 +84,7 @@ protected function registerCommands(): self
MakeResponse::class,
MakePlugin::class,
MakeAuthenticator::class,
ListCommand::class,
]);

return $this;
Expand Down

0 comments on commit 63441be

Please sign in to comment.