Once you start actually building something with Laravel, it’s easy to find yourself repeatedly typing the same code when you fetch relationships. This article shows you a centralised approach using scopes.
Imagine you have models for
Post and a relationship between the two —
Blog hasMany Post.