Query Scopes in laravel
Applying conditions to queries gives you to power to retrieve and present filtered data in every imaginable manner. Some of these conditions will be used more than others, and Laravel provides a solution for cleanly packaging these conditions into easily readable and reusable statements, known as a scope. In this tutorial I’ll show you how to easily integrate scopes into your Laravel models.
Consider a filter that only retrieves completed list tasks. You could use the following where condition to retrieve those tasks:





