How to write about laravel sorting first and grouping later

I know the original, but I can"t write it in the laravel way, because there are still pages in the back. It"s too troublesome to write your own pages. Which god would like to talk about it? thank you.
the following is the native sql

.

select * from (select f.idrecoveryf.useraccounidreu.nicknamedirection f.signrecoveryf.contentPowerf.statusreachf.useraccounipjournal f.setconsumtime from feedback as users as u where f.user_id=u.id order by set_time desc) as t group by t.user_id

Mar.20,2021

The

field is a little different. Change it yourself

DB::enableQueryLog();

$subQuery = DB::table(DB::raw('`feedback` as f,`users` as u'))
    ->where('f.user_id', '=', DB::raw('`u`.`id`'))
    ->orderBy('f.created_at', 'desc')
    ->select(['f.id', 'f.user_id', 'u.name', 'f.content', 'f.created_at']);
$query = DB::table(DB::raw("({$subQuery->toSql()}) as t"))
    ->mergeBindings($subQuery)
    ->groupBy('t.user_id')
    ->get(['t.*']);

$result = DB::getQueryLog();

print_r($result);

printed result:

Array
(
    [0] => Array
        (
            [query] => select `t`.* from (select `f`.`id`, `f`.`user_id`, `u`.`name`, `f`.`content`, `f`.`created_at` from `feedback` as f,`users` as u where `f`.`user_id` = `u`.`id` order by `f`.`created_at` desc) as t group by `t`.`user_id`
            [bindings] => Array
                (
                )

            [time] => 112.89
        )

)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e516d2-45136.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e516d2-45136.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?