July 2017
Intermediate to advanced
456 pages
11h 32m
English
This attribute defines how long the instance of the service is used by the Service Container. With the default value, "container," the Service Container always uses the same instance of the service. Other options include "prototype", which ensures the Service Container creates a fresh copy of the service for every request, and "request" ,which means the Service Container will create a new copy for every request or sub-request. Using "request" means that the service cannot be used in contexts where there is no request, namely the CLI.
Read now
Unlock full access