Instead of creating a "lib" folder, I usually follow the following folder structure: app ---- Support -------- Contracts - The interfaces (e.g PaymentDriver) -------- Managers - The managers (e.g PaymentManager) -------- Services - The implementations (e.g StripePaymentDriver) And then the users can do something like: app(App\Support\Contracts\PaymentDriver::class) or inject into class method that will be resolved from the container.
I have a feeling that there are multiple patterns with different names doing the same thing. Like this manager pattern is the same as strategy pattern and in the end repository pattern (but deals only with data) is that right in you opinion? It all comes down to code against interface
Instead of creating a "lib" folder, I usually follow the following folder structure:
app
---- Support
-------- Contracts - The interfaces (e.g PaymentDriver)
-------- Managers - The managers (e.g PaymentManager)
-------- Services - The implementations (e.g StripePaymentDriver)
And then the users can do something like:
app(App\Support\Contracts\PaymentDriver::class) or inject into class method that will be resolved from the container.
Thank you for the unique content. I often inject the mentioned managers into my classes instead of using the facades.
Great video. Thanks for this.
It seems to me that this is just one of the implementations of an abstract factory
thank you i was searching for this
I have a feeling that there are multiple patterns with different names doing the same thing. Like this manager pattern is the same as strategy pattern and in the end repository pattern (but deals only with data) is that right in you opinion? It all comes down to code against interface
yes that is pretty much OOP in a nutshell. At the end of the day, it is the implementation of interface methods that really counts
The manager pattern feels more like a factory for me
❤ Interesting
create video on laravel intermediate to advanced
Please sir make at least one video in week for your viewers
I have a lot more lessons in my website, would love to see you there!