Question: eloquent modifying variable without overwriting
I have been trying to perform some queries using a set variable with models inside it
so what I'm trying to do is something like this
$orders = (new Order)->where('placed_by', '=', "client");
if you die and dump this the outcome would be as expected now
let's find something specific
$totalPrice = $orders->where('total_price', '=', "100");
and then find something else
$totalPrice = $orders->where('total_price', '=', "10");
what you would think that the $orders variable contents would stay static but it doesn't it changes now is there a way to keep it as is without php error it changing because of the next operations?
9codings