Use Integrations Path when creating new classes #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #47
When working on #46, I added the ability to specify an
integrations_path
within the Saloon config file, so that if an application was using a different architecture, such as DDD, thesaloon:list
command would continue to work, providing that the config value was set correctly.This PR goes one step further with that config value, in that if it's set, it will create classes in that path. Let's say we have an application using the DDD approach. Instead of our integrations living in the default location of
app/Http/Integrations
, we have them inapp/Domain
and have updated thesaloon.integrations_path
so it's correct, when we runphp artisan saloon:request
and fill in all the prompts, you'll see:Note the path in the confirmation message
If we wanted to segment them further, perhaps we integrate with multiple Payment APIs, we could set Payment/Stripe as the Integration name, and that will give us the following:
If the
saloon.integrations_path
config isn't set in the application, then it will fallback to use the default location ofapp/Http/Integrations
:I can also confirm that
saloon:list
will still work:I'm pretty happy with the little amount of code this took to achieve. This update has definitely been a long time coming, that's for sure! As always, I'm happy for any feedback!