In my Laravel 5.2 controller, I'm executing a request with Eloquent ORM :
$products = Product::where('first_condition', 'first_condition_value')
->where('second_condition', 'second_condition_value')
->get();
This request works fine and gives me a list of the products that match the two conditions.
Ideally, I would like to generate a $request variable and use it in my request:
$request = "where('first_condition', 'first_condition_value')->where('second_condition', 'second_condition_value')"
I didn't manage to make this code run.
To give you more perspective, the request can have multiple conditions from 2 to n so I would like to generate it with a for loop.