check()) { $ids = explode(',', $value); /** @var \Illuminate\Support\Collection $object */ $object = Budget::where('active', 1) ->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; } }