where('account_types.editable', 1) ->whereIn('accounts.id', $ids) ->where('user_id', Auth::user()->id) ->get(['accounts.*']); if ($object->count() > 0) { return $object; } } throw new NotFoundHttpException; } }