public function __construct($models = [], $readonly = false) { parent::__construct([], $readonly); foreach ($models as $model) { // Trigger the set method so the provider is set. $this[] = $model; } }
public function __construct($data = [], $readOnly = false) { parent::__construct($data, $readOnly); // Make sure we are keeping track of our original data to be able to do diffs later. $this->setOriginalData($data); }