I have these two variables
$categories = Relation::select('child_id', 'distance')
->where('parent_id', $request->who)
->orderBy('distance', 'asc')
->get();
$request->newParent;
Is there any way to check if my query result($categories) contains id same as $request->newParent without making another database query.