App\Data\Repositories\Repository::__call PHP Method

__call() public method

Implement a convenience call to findBy which allows finding by an attribute name as follows: findByName or findByAlias.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
return mixed
    public function __call($method, $arguments)
    {
        /*
         * findBy convenience calling to be available
         * through findByName and findByTitle etc.
         */
        if (preg_match('/^findBy/', $method)) {
            $attribute = strtolower(substr($method, 6));
            array_unshift($arguments, $attribute);
            return call_user_func_array(array($this, 'findBy'), $arguments);
        }
    }