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

Hooks? #10

Open
elfeffe opened this issue Jun 21, 2020 · 5 comments
Open

Hooks? #10

elfeffe opened this issue Jun 21, 2020 · 5 comments
Assignees
Labels

Comments

@elfeffe
Copy link

elfeffe commented Jun 21, 2020

Does it supports Hooks?
I have found this package https://github.com/tormjens/eventy
But does your package offers that functionality?

@fulopattila122
Copy link
Contributor

No, apps written with Concord are typically using the default Laravel Event system to achieve such functionality. Concord itself fires a couple of events and also supports apps/modules to disable events.

Nevertheless, you can use the mentioned package along with Concord without any problems.

Does this properly answer your question?

@elfeffe
Copy link
Author

elfeffe commented Jun 21, 2020

Sorry, but can you show me how to do that? Because the conventional approach is very criticized because “listeners but not return values”.
What I need is to create some event getPaymentMethods and the plugins must return their methods. Do you have any example?

@fulopattila122
Copy link
Contributor

As an example, the Vanilo Payment module (which is built on top of Concord) is using the registry pattern to achieve such functionality: https://github.com/vanilophp/payment/blob/master/src/PaymentGateways.php#L22

And any plugin for the payment module can register itself with PaymentGateways::register(...)
Example plugin registering itself: https://github.com/artkonekt/vanilo-euplatesc/blob/master/src/Providers/ModuleServiceProvider.php#L26

@elfeffe
Copy link
Author

elfeffe commented Jun 21, 2020

Great, thanks a lot

@elfeffe
Copy link
Author

elfeffe commented Jun 21, 2020

@fulopattila122 I didn't see you are the developer, I have been following Vanilo for some time, from the first beta.
When do you plan to release the payments ans shipping modules? I think I can use them in my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants