Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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();
Comment

PREVIOUS NEXT
Code Example
Php :: php count occurrences of string in array 
Php :: How to create and access angular HTTP params in PHP 
Php :: show image laravel 
Php :: docker : from php alpine 
Php :: php if elseif 
Php :: eloquent get trashed record 
Php :: Creating default object from empty value 
Php :: php - How do I calculate the percentage of a number? 
Php :: laravel model sync 
Php :: laravel merge two query builder 
Php :: where is phpinfo() 
Php :: php using composer autoload - own code 
Php :: php ++ 
Php :: how to make arrays in php 
Php :: laravel blade conditional class 
Php :: php decode json object 
Php :: laravel casts 
Php :: php excel to array 
Php :: cakephp 4 change layout view in a method 
Php :: Termlaravel validation exists array rules 
Php :: php associative array join key values 
Php :: get file size in php 
Php :: wordpress remove taxonomy from post 
Php :: php quotations within quotations 
Php :: laravel attach 
Php :: update php version wamp windows 
Php :: laravel image store 
Php :: wordpress send reset password link inside wp_new_user_notification_email 
Php :: add brackets to string php 
Php :: Unknown column type "double" requested. Any Doctrine type that you use has to be registered with DoctrineDBALTypesType::addType 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =