Anyone know why this factory is giving same time for all variables?
What I get is this:
CodePudding user response:
this is the way how carbon works ...
$from->addDays(3)
will make $from itself after three days ...
to avoid this, you can use make
method:
$to= Carbon::make($from)->addDays(rand(1,7));
make
method will make a copy of the variable, as you expect.