Replies: 1 comment
-
If I understand correctly a real world example of your question scenario would be: Having different modules to handle payments. One for Stripe, another for PayPal an so on. And depending on the installation you choose one of them. Is it right? If yes, the way I see to implement it is just like Laravel Cashier. It has the main package for Stripe, ano others for PayPal em Molie |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
nice to meet you and thank you for your awesome work on laravel-modules!
I have the following question:
Consider the standard scenario, in which you have numerous
modules
created, that are dealing with different problems and as such are quite separate (functional wise) from the rest of the app.There is however that one functionality, that may differ amongst instances of the app installed in different environments, let it be fetching of some vendor's APIs, that differ between themselves, but are containing data, that in every environment should be consumed by other modules in the same way.
How would you approach creating the structure, to support swapping (with a single
composer require
) a module responsible for fetching the vendor API, but also keep all the modules compatibility intact?Sure thing (or not?) is, that those modules should have their classes structure very alike (probably implement the same interfaces).
On
laravel-modules
level, the problem probably means checking if there is a module that serves the purpose of API fetcher, and throwing an error if there is no such module, or if there is loaded more then 1 such module.Is this possible with built-in helpers or in any other way supported by
laravel-modules
?Beta Was this translation helpful? Give feedback.
All reactions