public function findFirstByKey($key)
    {
        if ($this->useSoftDeletes) {
            return $this->repository
                ->withTrashed()
                ->where($this->repository->getRouteKeyName(), $key)
                ->first();
        }

        return $this->repository
            ->findBy($this->repository->getRouteKeyName(), $key);
    }