Christoph Rumpel wrote a clear post on how you can use Laravel’s service container.
The service container is a quite complex topic, and I see many struggling to understand what it does. It was the same for me, and the main reason is that many explanations concentrate on "how" to use the container. With this article, I want to give you my introduction to this topic by focusing on the "why" and "when" the container can help us with our dependencies.
Source: Freek Van der Herten