OptionalregisterThe register method is called to register bindings in the IoC container. This is where you should bind services, singletons, and other dependencies.
OptionalbootThe boot method is called to boot application state. Use this method for registering macros, middleware, REPL bindings, and other application-level configurations.
OptionalstartThe start method is called after all providers have been booted. This is the ideal place to use existing container bindings and perform startup operations that depend on other services.
The method is called before the preload files are imported and therefore it must not rely upon anything registered by them.
OptionalreadyThe ready method is called when the application is fully ready. For HTTP servers, this is called after the server starts listening. Preloaded files have been imported and the app is ready to serve requests.
The method is never called for an app booted in the "warmup" mode.
OptionalshutdownThe shutdown method is called during graceful application shutdown. Use this method to clean up resources, close connections, and perform other cleanup tasks. Avoid long-running operations to prevent forceful termination.
The method is only called for an app that has been started. An app booted in the "warmup" mode never opens any resources and therefore terminates without invoking this method.
Contract for service provider classes. Service providers are used to register bindings in the IoC container and boot application services during different lifecycle phases.
Example