Skip to content

fix for when integrations_path is outside app/#78

Merged
JonPurvis merged 2 commits intosaloonphp:v3from
JonPurvis:fix/integrations-path-outside-app
Mar 8, 2026
Merged

fix for when integrations_path is outside app/#78
JonPurvis merged 2 commits intosaloonphp:v3from
JonPurvis:fix/integrations-path-outside-app

Conversation

@JonPurvis
Copy link
Collaborator

Fixes saloonphp/saloon#476

When integrations_path is set to a path outside app/ (e.g. base_path('src/Domains/Integrations')), the saloon:connector and other make commands were still writing files under app/, producing paths like app/src/Domains/Integrations/... instead of src/Domains/Integrations/....

The namespace was correctly derived from integrations_path via getNamespaceFromIntegrationsPath(), but the file path was always built from $this->laravel['path'] in Laravel’s GeneratorCommand::getPath().

Override getPath() in MakeCommand so that when the class’s relative path starts with the segment from the configured integrations_path, the destination path is built from config('saloon.integrations_path') instead of the app path. Default config (app/Http/Integrations) is unchanged.

Copy link
Member

@Sammyjo20 Sammyjo20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @JonPurvis! There's one PHPStan gremlin, once this is resolved feel free to tag.

@JonPurvis
Copy link
Collaborator Author

Gremlin banished! I'll get a new patch release tagged!

@JonPurvis JonPurvis merged commit 1dc8c07 into saloonphp:v3 Mar 8, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CONFIG] Wrong path Laravel-Plugin on command execution

2 participants