In order to understand or decide on when/ where to use repository patten, we first have to understand the basic concept of this.
What is the advantage here ?: The main advantage of this implementation is that the application doesn’t have to know about the data source to which it’s connecting.
When to use it ?: It’s not suggested to use this pattern for small implementations rather we should use this in the application where we may have multiple data sources.
In the example I am explaining everything in such a way that we have the Laravel application configured and running.
Now, we have to add server provide in app.php file, so add UserRepoServiceProvide in config/app.php and add bellow line.