Laravel's service container is one of the core pillars of the entire framework. Before we review the real implementation, let's first take a few moments to build a simple service container from scratch. This will give you an instant understanding of what happens under the hood when you bind and resolve keys.
app/Models
directory. This means an App\Post
namespace should now be App\Models\Post
.