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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners