Category: Laravel, PHP, api

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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners