D
D
Dmitry2017-07-31 21:14:30
Laravel
Dmitry, 2017-07-31 21:14:30

How are classes initialized in a Laravel service container?

Short question, I can't figure it out.
The service container contains instances of user classes (created by us) and service ones, so to speak.
I can’t understand, these instances are created there on demand, for example, when we call
App::make('our class bound through the service provider') in the controller, an instance of the required class is created, or every time the application starts, all objects are created by a 'heap' and then they just give it to us. ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2017-07-31
@Sad_Bro

On demand and nothing else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question