You need to use the eloquent Raw function.
DB::raw(your sql)
In your case, the following query should work:
->orderBy(DB::raw('convert(name using gbk)'))
If you want to use raw sql in your where statements, you can use the whereRaw() shortcut function to select the selectRaw() function as selectRaw() .
source share