Model values assignment issue I am setting attributes on my record using a models' attributes (that has validated successfully). I cannot figure out why the values aren't assigned. I can manually assign each one but that's redundant.

// Set attributes
// Massive assignment will only be made for fields which have passed some explicit validation rule.
if ($model-&gt;validate())
{
    $purchaseRecord-&gt;setAttributes($model-&gt;getAttributes());
    var_dump($model-&gt;snipInvoiceNumber); // works
    var_dump($purchaseRecord-&gt;snipInvoiceNumber); // null value
    $purchaseRecord-&gt;snipInvoiceNumber = $model-&gt;snipInvoiceNumber; // works
} 


UPDATE:
Per comments on this thread I looped through and set the attributes individually. Anyone have insight on why setAttributes didn't work? 
Save contact form data to database

This is what I used instead of setAttributes (plural).

foreach ($model-&gt;getAttributes() as $key =&gt; $value ) {
    $purchaseRecord-&gt;setAttribute($key, $value);
}
There is a second parameter  in your setAttributes() function. This parameter is true per default and checks if the attribute is safe so you either have to declare all safe attributes in your records rules or you set the parameter to false.