where('enabled', true) ->pluck('id') ->toArray(); if(count(array_diff($formattedVal, $validIds)) !== 0) { $fail('the :attribute must be enabled.'); } } }