Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Integrations Path when creating new classes #56

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

JonPurvis
Copy link
Contributor

@JonPurvis JonPurvis commented Jan 29, 2024

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, the saloon: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 in app/Domain and have updated the saloon.integrations_path so it's correct, when we run php artisan saloon:request and fill in all the prompts, you'll see:

image

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:

image

If the saloon.integrations_path config isn't set in the application, then it will fallback to use the default location of app/Http/Integrations:

image

I can also confirm that saloon:list will still work:

image

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!

@JonPurvis
Copy link
Contributor Author

@Sammyjo20 As promised! 😄

Would you be able to take this for a test drive?

@JonPurvis JonPurvis force-pushed the use-integrations-path branch 2 times, most recently from b8cf0ea to 6059a3c Compare January 29, 2024 03:47
@JonPurvis JonPurvis changed the title use integrations path Use Integrations Path when creating new classes Jan 29, 2024
@Sammyjo20
Copy link
Member

Hey @JonPurvis sorry for the slow reply on this one! Thank you so much for adding this functionality - I will give this a test drive this weekend.

@JonPurvis
Copy link
Contributor Author

Hey @Sammyjo20 not a problem, you're a busy guy! 😄 Let me know if you spot anything you want changing and I'll get right on it!

@Sammyjo20
Copy link
Member

This works really well amazing work as always @JonPurvis - Thank you

@Sammyjo20 Sammyjo20 merged commit ea38f6f into saloonphp:v3 Feb 7, 2024
14 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.

[Feature request] Create classes directly in integrations_path directory
2 participants