How to get latest updated or created record in laravel
if i use latest() it only considered created_by value.
$tasks->latest();
if i use orderBy
$tasks->orderBy('created_at,'DESC');
then it is not working for latest updated.
$tasks->orderBy('updated_at,'DESC');
then its is not working for created_at
How to get latest created or latest updated Record. Basically, the most recent activity record? Thanks in advance!
$tasks->orderBy('updated_at,'DESC');
updated_at
是任何活动(创建/更新)的最新时间戳,因此这应该适用于两种情况。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.