I am doing this in laravel and getting unexpected result
$remitter = Remitter::where('mobile', '9946617986')->first();
$new = $remitter;
$new->rohan = 'Rohan';
unset($remitter->rohan);
dd($new);
here I just grabbed one eloquent object $remitter and then I pushed it in another variable $new Now when I created one tag named "rohan" on new it gets added into $remit开发者_JS百科ter too
now when I unset $remitter->rohan
rohan tag was also removed from $new too why this is happening ?
why this is working like referencing ?
any Ideas
$new = collect($remitter->toArray());
加载中,请稍侯......
精彩评论