Lesson 5: Laravel Deferred Service Providers: Improve Performance by Deferring Loading of Services

Abishek
Work Done Right
Published in
3 min readMay 8, 2023

--

This is a continuation of our Service Providers Series.

In this blog post, we will explore what Deferred Service Providers are, how they work, and how to use them to improve your Laravel application’s performance.

What are Deferred Service Providers?

In Laravel, Service Providers are responsible for registering services with the application’s service container. The service container is a powerful tool that allows you to manage dependencies and resolve them when needed. However, registering all services at once can slow down your application’s startup time, especially if some services are not needed immediately.

Deferred Service Providers allow you to defer the loading of certain services until they…

--

--

Abishek
Work Done Right

I like to write about different stuff that may be of help to people. I am a husband and a software developer constantly learning new things every single day.