public function search($input, $compareAttributes = ['*'], $attributes = ['*'])
    {
        $query = $this->query();

        $compareAttributes = $compareAttributes ?: ['*'];

        if ($compareAttributes == ['*']) {
            $compareAttributes = Schema::getColumnListing($this->model->getTable());
        }

        foreach ($compareAttributes as $column) {
            $query->orWhere($column, 'like', '%'.join('%', str_split($input)).'%');
        }

        return $query->get($this->selectAttributes($attributes));
    }