臭鼬 的个人博客 / 0 / 2 / 创建于 4年前 / 更新于 4年前
获取全部通知
Auth::user()->notifications()->get()p
查询结果日期如何转换
本作品采用《CC 协议》,转载必须注明作者和本文链接
你应该说明laravel版本的。。。
@bhlsunshine 发现这个
$users = User::select([ 'users.*', 'last_posted_at' => Post::selectRaw('MAX(created_at)') ->whereColumn('user_id', 'users.id') ])->withCasts([ 'last_posted_at' => 'date' ])->get();
但我用withCasts 貌似没效果
一个简单暴力的方法 toArray()
我要举报该,理由是:
推荐文章: