Hash password before saving with Laravel Backpacker
<p>A simple question: <strong>how do I modify (hash) the request value before saving it with Laravel Backpacker CRUD admin?</strong></p>

<p>As far as i understand, it should be done somewhere before these methods are executed in the crud controller:</p>

<pre><code>public function store(StoreRequest $request)
{
    return parent::storeCrud();
}

public function update(UpdateRequest $request)
{
    return parent::updateCrud();
}
</code></pre>

<p>but I have no idea how to do it correctly.</p>

<p><em>Edit</em>: the request is not a <code>Request</code> object, but rather <code>StoreRequest</code> or <code>UpdateRequest</code> that looks something like this:
<a href="https://i.stack.imgur.com/BQipB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BQipB.png" alt="enter image description here"></a></p>

<p><strong><em>Fix</em></strong>: </p>

<pre><code>public function update(UpdateRequest $request)
{
    // Hash password before save
    if (!empty($request-&gt;password)) {
        $request-&gt;offsetSet('password', Hash::make($request-&gt;password));
    }

    return parent::updateCrud($request); // &lt;-- Pass the modified request, otherwise the CRUD reads it again from post data
}
</code></pre>