How to merge Laravel objects in controller

Solution:1

Nowadays you can use

$new_collection = $collection->merge($other_collection).

This works in Laravel 4 and seems to handle both arrays and collections.

Solution:2

What you can do here is merge the arrays of the two query result and then use the Response with json output like shown below.

$array = array_merge($mc->toArray(), $sm->toArray());
return Response::json($array);