B
B
BonBon Slick2017-08-11 23:15:57
SQL
BonBon Slick, 2017-08-11 23:15:57

Why is the request broken?

$bans=  Blacklist::with(['banned' => function ($query) use ($text, $order, $type) {
                    $query->whereRaw("CAST(ip AS TEXT) ILIKE '%$text%'")
                        ->orWhereRaw("CAST(spec_id AS TEXT) ILIKE '%$text%'")
                        ->orWhere('email', 'like', '%' . $text . '%')
                        ->orWhere('name', 'like', '%' . $text . '%')
                        ->orderBy($type, $order);
                }, 'bannedBy'])->get();
                dd($bans);

If you remove this line, everything works, why?
>orWhere('name', 'like', '%' . $text . '%')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question