Category: PHP, PHP

What are DI and IOC? If you say DI-Dependency Injection, IOC-Inversion of control you are right but wait “There is a difference between knowing the name of something and knowing something”.

In the above code, ChargeBee clas s uses the ChargeBeeSubscription class,which means if you want to create the ChargeBee object we need ChargeBeeSubscription Object.

We are injecting the ChargeBeeSubscription object to the ChargeBee constructor and the ChargeBee object to PaymentGateWay constructor.

Having control in multiple places or having control in a single place, which is easy to manage.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners