title: laravel backpack user password
body: <p>I made a crud for my users in backpack. When I create a user everything works fine but if I update I get an error for "Password" since if I dont want to update it I leave it blank and password cannot be null. </p>
  
  <p>How can I not add "password" to the POST if I leave it blank? Or how do I default to the current password?? and also have a "confirm" field?</p>
  
  <p>In UserCrudController.php</p>
  
  <pre><code>&lt;?php 
  
      namespace App\Http\Controllers\Admin;
  
      use Backpack\CRUD\app\Http\Controllers\CrudController;
      use App\User;
      use Auth;
  
      // VALIDATION: change the requests to match your own file names if you need form validation
      use App\Http\Requests\UserCrudRequest as StoreRequest;
      use App\Http\Requests\UserCrudRequest as UpdateRequest;
  
      class UserCrudController extends CrudController {
  
          public function setup() {
              $this-&gt;crud-&gt;setModel("App\User");
              $this-&gt;crud-&gt;setRoute(config('backpack.base.route_prefix')."/user");
              $this-&gt;crud-&gt;setEntityNameStrings('user', 'users');
  
              $this-&gt;crud-&gt;setColumns([
                  ['name' =&gt; 'lastname', 'label' =&gt; "Last Name"],
                  ['name' =&gt; 'firstname', 'label' =&gt; "First Name"],
  
              ]);
  
  
              $this-&gt;crud-&gt;addFields([
                  [
                      'name' =&gt; 'firstname',
                      'label' =&gt; "First name"
                  ],
                  [
                      'name' =&gt; 'lastname',
                      'label' =&gt; "First name"
                  ],
  
  
                      [   // Password
                          'name' =&gt; 'password',
                          'label' =&gt; 'Password',
                          'type' =&gt; 'password'
                      ],
  
              ]);
  
  
          }
  
          public function store(StoreRequest $request)
          {
              // &lt;---------  here is where a before_insert callback logic would be
  
              $response = parent::storeCrud();
  
              // &lt;---------  here is where a after_insert callback logic would be
  
              return $response;
          }
  
          public function update(UpdateRequest $request)
          {
              $user = User::find(Auth::user()-&gt;id);
  
              // Hash password before save
              if (!empty($request-&gt;password)) {
                  $request-&gt;offsetSet('password', Hash::make($request-&gt;password));
              }else{
                  $request-&gt;offsetSet('password', $user-&gt;password );
              }
  
              return parent::updateCrud();
          }
      }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code> Integrity constraint violation: 1048 Column 'password' cannot be null (SQL: update `users` set `password` = , `updated_at` = 2017-10-06 15:08:25 where `id` = 1)
  </code></pre>