protected function getBindingCallable($binder, $value)
    {
        // If $binder is a callable then use it, otherwise resolve the callable :
        if (is_callable($binder)) {
            return $binder;

        // If $binder is string (class name or Class@method)
        } elseif (is_string($binder)) {
            // Check if binder is CLass@method callable style
            if (strpos($binder, '@') === false) {
                $class = $binder;
                $method = null;
            } else {
                list($class, $method) = explode('@', $binder);
            }

            if (!class_exists($class)) {
                throw new Exception("Route-Model-Binding : Class not found : [$class]");
            }

            $instance = $this->resolveClass($class);

            // If a custom method defined, use it, Otherwise, use the default binding callable
            if ($method) {
                return [$instance, $method];
            } else {
                return $this->getDefaultBindingResolver($instance, $value);
            }
        }

        throw new InvalidArgumentException('Route-Model-Binding : Invalid binder value, Expected callable or string');
    }
protected function getBindingCallable($binder, $value)
    {
        // If $binder is a callable then use it, otherwise resolve the callable :
        if (is_callable($binder)) {
            return $binder;

        // If $binder is string (class name or Class@method)
        } elseif (is_string($binder)) {
            // Check if binder is CLass@method callable style
            if (strpos($binder, '@') === false) {
                $class = $binder;
                $method = null;
            } else {
                list($class, $method) = explode('@', $binder);
            }

            if (!class_exists($class)) {
                throw new Exception("Route-Model-Binding : Class not found : [$class]");
            }

            $instance = $this->resolveClass($class);

            // If a custom method defined, use it, Otherwise, use the default binding callable
            if ($method) {
                return [$instance, $method];
            } else {
                return $this->getDefaultBindingResolver($instance, $value);
            }
        }

        throw new InvalidArgumentException('Route-Model-Binding : Invalid binder value, Expected callable or string');
    }
protected function getBindingCallable ( $ binder , $ value ) { // If $binder is a callable then use it, otherwise resolve the callable : if ( is_callable ( $ binder ) ) { return $ binder ; // If $binder is string (class name or Class@method) } elseif ( is_string ( $ binder ) ) { // Check if binder is CLass@method callable style if ( strpos ( $ binder , '@' ) === false ) { $ class = $ binder ; $ method = null ; } else { list ( $ class , $ method ) = explode ( '@' , $ binder ) ; } if ( ! class_exists ( $ class ) ) { throw new Exception ( "Route-Model-Binding : Class not found : [$class]" ) ; } $ instance = $ this -> resolveClass ( $ class ) ; // If a custom method defined, use it, Otherwise, use the default binding callable if ( $ method ) { return [ $ instance , $ method ] ; } else { return $ this -> getDefaultBindingResolver ( $ instance , $ value ) ; } } throw new InvalidArgumentException ( 'Route-Model-Binding : Invalid binder value, Expected callable or string' ) ; }
Get the callable for the binding

@param  mixed $binder
@param  string $value

@return callable

@throws Exception
@throws InvalidArgumentException
Get the callable for the binding