Repository design pattern done right in Laravel
https://medium.com/@daaaan/repository-design-pattern-done-right-in-laravel-d177b5fa75d4
In this post I will show you how to setup the repository design pattern in Laravel from scratch. I will be using the Laravel 5.8.3 version, but the Laravel version shouldn’t really matter too much. Before we start coding there are a few things you need to know about the repository design pattern.
The repository design pattern allows you to use objects without having to know how these objects are persisted. Essentially it is an abstraction of the data layer.