public function __call($method, $parameters) { if (Str::startsWith($method, 'findBy')) { $attribute = str_replace('findBy', '', $method); $model = $this->model; if ($model::$snakeAttributes) { $attribute = Str::snake($attribute); } array_unshift($parameters, $attribute); return call_user_func_array([$this, 'findBy'], $parameters); } throw new \BadMethodCallException('Invalid method: '.$method); }