Filtering

Scenario

You have a blog application and on the index page you have a list with all posts. A post belongs to a category so you want to have a dropdown to filter the posts per category.

Scopes

Scenario

You have a webshop and you want to display all products that are on sale.
Let’s asume your products table has a column named sale and is of the type boolean.

Namespacing routes

Scenario

You have a webshop and the customers can view the products but they shouldn’t be able to edit or create a product.
So the only action you want to have in the ProductsController is index.
In order to give the admin full control over the products it’s better to provide him a different controller.