I am new to all this stuff. I mean I understand how OOP works but not really. I guess every novice developer was at my place at some point. So I have been going through Jeffrey's awesome Laracasts to understand how this stuff really works.
So I just completed a lesson on Interfaces where he explained "Always work with interfaces and never with implementations" and makes sense to me but I have a doubt with the last example which goes like:
He explains how CanBeFiltered Interface is useful and I get it that if I pass this interface into a constructor of a controller, Laravel will, behind the scenes, resolve a particular filter of my choice and inject it and then I will be able to use it. Or I can do it manually like so:
<?php
class UserController{
protected $canBeFiltered;
public function __construct(CanBeFiltered $canBeFiltered)
{
$this->canBeFiltered = $canBeFiltered;
}
public function show()
{
return $this->canBeFiltered->filter();
}
}
$controller = new UserController(new Favorited);
And this will basically apply the favorited filter but what if I want to apply multiple filters like if I want to apply favorited and unwatched? What do I do then?
And moreover, Laravel's IoC container will automatically resolve dependencies for me so how will pass different filters to different controllers?

when()->needs()->give(). See here.