Package Configuration - services
The services
section allows you to mark various classes as services. Once marked as a service, the class will only be instantiated once during each request. If you try to make the class multiple times via the container during a request, you will always get the instance that was initially instantiated. This allows you to preserve values of any properties among other things.
This section is simply a one-dimensional array of fully qualified class names to mark as services, for example:
services:
- App\\MyPackage\\Lib\\SomeService
- App\\MyPackage\\Controllers\\SomeController
The above classes will then only ever be instantiated once per-request.