Answers for "laravel query foreach"

PHP
0

laravel query foreach

$listing = Listing:where('id', $id);
foreach ($input as $key => $value) {
     $i++;
     // ->where('field_1', red_1); // Desired output
     $listing->where("where(field_{$i},".$value."_1)");
}
$results = $listing->get();
Posted by: Guest on July-16-2020

Browse Popular Code Answers by Language