Support the ongoing development of Laravel.io →
Packages Architecture
Last updated 1 year ago.
0

Hi bonty,

Laravel takes away alot of the hassle of handling dependency injection. Make sure you read through [http://laravel.com/docs/ioc] and more specifically [http://laravel.com/docs/ioc#service-providers]. The concept of an IoC container can be confusing at first but once you start to hand all your dependencies to the IoC container you'll wonder how you lived without it.

All dependencies are created by laravel automatically by checking the typehint of each variable in the class constructor. If that dependency needs to be set up in a way that the IoC doesn't by default just do that set up in a service provider and bind that new instance to its class name.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

bonty233 bonty233 Joined 16 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.