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?
I have this base query:
How can I set a searchable function that will search the company model.
Above is not working, what am I missing?