I want to convert this SQL query to Query builder Laravel
SELECT * FROM articles ORDER BY (titre LIKE '%book%') DESC
Updated: Try the following code:
DB::table('articles')->orderBy(DB::raw("title LIKE '%$value%'"),'desc')->get();
I think the following one also solves your problem:
DB::table('articles')->orderByRaw("(title LIKE '%book%') DESC")->get();