Collections in Laravel have a ton of undocumented functions that can come in handy someday. One such function is the
merge() function. It will merge a collection, a class that implements the ArrayableInterface, or an array into another collection and return a single collection containing all the elements in the two objects. This will come in handy when combining the results of two database queries together.
$users = User::where('name', '!=', 'Frank')->get(); $cars = Car::where('color', '=', 'blue')->get(); $combo = $users->merge($cars);