In validation I didn't set the product field name to unique but want to it unique in some ways like products with same user_id, I want a single user have unique products name. So did some code to match value which is product field name to an array of product names from database.
$products = Product::find(auth()->user()->id)->get();
foreach ($products as $product) {
$pro_name = $product->name;
}
$value = Input::get('name');
if ($value == anyOf($pro_name) {
return false;
}