Skip to content

Searchable function on base query #1

@sredbull

Description

@sredbull

I have this base query:

// base query
      query () {
        return User
          .query()
          .with('company')
          .with('role')
          .on('query', console.log)
      },

How can I set a searchable function that will search the company model.

searchable: [
        function company (q, search) {
          console.log(q.from('companies').orWhere('companies.name', 'like', '%search%'))
        }
 ]

Above is not working, what am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions