Laravel 5.2: Eloquent Mutator Not Saving Value on Create
<p>So, I'm simply trying to hash a password on user creation, using an Eloquent mutator. It works perfectly if I update the attribute and save it, but on <code>create()</code> it isn't saved - the <code>password</code> column is empty.</p>

<pre><code>public function setPasswordAttribute($password){
    $this-&gt;attributes['password'] = Hash::make($password);
}
</code></pre>

<p>Why does this happen? Do I need to set all mutated columns individually to make them save?</p>

<p>Thanks for your help.</p>

<hr>

<h2>Update</h2>

<p>I tried saving the password individually, and that didn't work either. For some reason, the value is getting lost somewhere.</p>

<hr>

<h2>Update 2</h2>

<p>I tried separating the hashing from saving the value to the attribute and dd()'d it out. It's hashed properly, but it still doesn't save when the registration form is submitted.</p>

<pre><code>public function setPasswordAttribute($password){

    $newPass = Hash::make($password);
    $this-&gt;attributes['password'] = $newPass;
}
</code></pre>

<hr>

<h2>Update 3</h2>

<p>I commented out the mutator, and the password is still not being saved. At this point I know the value is being sent to the controller and that the model has access to it. For some reason however, it just isn't saved. Everything else is saved just fine, but not the password.</p>

<p>I have no idea what is going on here.</p>