First I create 2 different queries.
$first = first::where('id',$request->first_id)->select('name','created_at')->get();
$second = second::where('id', $request->second_id)->select('name','created_at')->get();
I then merge the two resulting arrays.
$data_combine = array_merge($first->toArray(), $second->toArray());
Finally, I'd like to sort the combined arrays in ascending order based on their created_at
value, e.g '2016-05-06 16:43:46'.