Hello lucabernardino,
you use dependency injection not because you need to have access to you class but to make your code better organized. usually you bind you class to an interface.
app::bind('MyNamespace/PaymentInterface', function(){ return new PaypalPayment(); })
so in the future is you change a payment method the only change you have to do is this line of code.
a better and more extended explanation can be found on Taylor's book "Laravel: From Apprentice To Artisan"
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community