I know how to bind a single class:
public function register() {
$this->app->bind('search', 'Laracasts\Search\Search');
}
But imagine my Laracasts\Search\
dir having these files:
- Search.php // class Search
- SearchX.php // class SearchX
- SearchY.php // class SearchY
- SearchZ.php // class SearchZ
What is the best way to bind these four files/classes into the search facade?
I read in another non-related question that we can use a mapper. But how?
Use a separate binding for each class/facade:
A binding can only be bound to one thing. Of course, within the bound class, you can do anything you like: