Repositories are classes or components that contain the logic needed to access data sources. Repositories provide centralized functionality for accessing data, allowing better management and separation of the infrastructure or technology used to access data from the domain model. If you’re using an object-relational mapping (ORM) like the Laravel Framework, the code you need to implement is simplified thanks to Eloquent and strong typing. This allows you to focus on the data persistence logic rather than the data access helper functions.
PHP 5 introduced us to a new error model that is still evolving today. This model allows you to throw and catch exceptions in your application - it’s a better way to handle errors than older versions of PHP. All exceptions are instances of the Exception base class, which we can extend to introduce our own custom exceptions.
If you’ve ever been familiar with the Laravel framework, it’s unlikely that you haven’t heard of service containers and service providers. In fact, they are the backbone of the Laravel framework and do all the heavy lifting when you launch an instance of any Laravel application.