protected function useWithTrashed(Builder $query)
    {
        if ($this->withTrashed && $query->getMacro('withTrashed') !== null) {
            return $query->withTrashed();
        }

        return $query;
    }