protected function resolveQueryConstraint(string $identifier)
    {
        if (! method_exists($this, $method = 'load' . ucfirst(camel_case($identifier)))) {
            return null;
        }

        return function ($query) use ($method) {
            return $this->$method($query);
        };
    }
protected function resolveQueryConstraint(string $identifier)
    {
        if (! method_exists($this, $method = 'load' . ucfirst(camel_case($identifier)))) {
            return null;
        }

        return function ($query) use ($method) {
            return $this->$method($query);
        };
    }
protected function resolveQueryConstraint ( string $ identifier ) { if ( ! method_exists ( $ this , $ method = 'load' . ucfirst ( camel_case ( $ identifier ) ) ) ) { return null ; } return function ( $ query ) use ( $ method ) { return $ this -> $ method ( $ query ) ; } ; }
Resolve a query constraint for a given relation identifier.

@param  string $identifier
@return \Closure|null
Resolve a query constraint for a given relation identifier .