I would like to validate an array by verifying that all the elements in an input is part of another array. For example, lets say I have three arrays:
$foo = ['John', 'Terry', 'Kim'];
$bar = ['John', 'Kim'];
$sub = ['John', 'Ringo'];
and I have a function called CompareArrays(). Doing CompareArrays($foo, $bar) would result in true because all the elements in $bar exists in $foo. However, CompareArrays($foo, $sub) would result in false because Ringo doesn't exist in foo. Implementing this in vanilla php is
!array_diff($foo, $bar)
How would I do this in a Laravel Validator without making a custom rule (v6.10) ?