whereIn('id', $ids) ->where('user_id', Auth::user()->id) ->get(); // add empty budget if applicable. if (in_array('0', $ids)) { $object->push(new Budget); } if ($object->count() > 0) { return $object; } } throw new NotFoundHttpException; } }