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.
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.
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.
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