public function createClassBinding($binding)
{
return function ($value, $route) use($binding) {
// If the binding has an @ sign, we will assume it's being used to delimit
// the class name from the bind method name. This allows for bindings
// to run multiple bind methods in a single class for convenience.
$segments = explode('@', $binding);
$method = count($segments) == 2 ? $segments[1] : 'bind';
$callable = [$this->container->make($segments[0]), $method];
return call_user_func($callable, $value, $route);
};
}