Answer the question
In order to leave comments, you need to log in
Laravel Postgres CAST on integer?
$query = Posts::where('owner.name', 'LIKE', '%' . $text . '%')
->orWhereRaw('CAST(owner.id TEXT) ILIKE "%' . $text . '%"')
->orderBy('owner.id', $order)
->select('posts.*', 'owner.*', )
->leftJoin('users as owner', 'posts.user_id', '=', 'owner.id')
->get();
Undefined column: 7 ERROR: column "%2%" does not exist LINE 1: ..._id" =
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question