IvanRadojevic
1 month ago
160
2
Laravel

Property [type] does not exist on this collection instance.

Posted 1 month ago by IvanRadojevic

This code in controller is working:

return $activities = $user->activity()->latest()->with("subject")->get();

but this is not (Property [type] does not exist on this collection instance.) Why?

$activities = $user->activity()->latest()->with("subject")->get()->groupBy(function ($activity) {
		return $activity->created_at->format("Y-m-d");
	});	

Please sign in or create an account to participate in this conversation.