I\'ve two Collections and I want merge it to one variable (of course, with ordering by one collumn - created_at). How Can I do that?
created_at
My Controllers look
A little workaround for your problem.
$posts = collect(Post::onlyTrashed()->get()); $comments = collect(Comment::onlyTrashed()->get()); $trash = $posts->merge($comments)->sortByDesc('deleted_at');
This way you can just merge them, even when there are duplicate ID's.