ajohnson64945 years agoLevel 11ReplyReport SpamThe latest() function simply sorts your data with the most recent record first. It takes an optional column name. It looks like you are trying to pass in part of a select statement, which will not work. Laravel Documentation You could maybe do something like: Tagin::where(DB::raw("created_at::date")), DB::raw("MAX(created_at::date)")->where('venue_id', $id)->get() Like Reply
siangboon5 years agoLevel 54ReplyReport Spamperhaps you need whereRaw / orWhereRaw instead of raw https://laravel.com/docs/8.x/queries#raw-methods Like Reply