title: SQLSTATE[HY000]: General error: 1364 Field 'photo' doesn't have a default value in laravel 5.5
body: <p>I am trying to upload users photo during registration, but I am getting this error, I searched online and founded possible solutions did not work for me.  I am using sentinel package for advanced authentication. Please anyone help me .
  Here is my controller-</p>
  
  <pre><code> public function postRegister(Request $request){
      $request-&gt;validate([
          'first_name' =&gt; 'required|max:255',
          'last_name' =&gt; 'required|max:255',
          'user_name' =&gt; 'unique:users|max:255',
          'email' =&gt; 'required|unique:users|email|max:255',
          'password' =&gt; 'required|min:6|confirmed',
          'phone' =&gt; 'required|numeric',
      ]);
      //upload image
      if ($file = $request-&gt;file('photo')) {
          $fileName = $file-&gt;getClientOriginalName();
          $extension = $file-&gt;getClientOriginalExtension() ?: 'png';
          $folderName = '/uploads/users/';
          $destinationPath = public_path() . $folderName;
          $safeName = str_random(10) . '.' . $extension;
          $file-&gt;move($destinationPath, $safeName);
          $request['photo'] = $safeName;
      }
  
      // $user = Sentinel::registerAndActivate($request-&gt;all());
      $user = Sentinel::registerAndActivate($request-&gt;all());
      // dd($user);
      //$activation = Activation::create($user);
  
      $role = Sentinel::findRoleBySlug('member');
  
      $role-&gt;users()-&gt;attach($user);
      //$this-&gt;sendEmail($user, $activation-&gt;code);
      //return redirect('/login');
      return ('You have seccsessfully registered. Now login to start');
  }
  </code></pre>
  
  <p>And form input-(with enctype="multipart/form-data" top of the form)</p>
  
  <pre><code> &lt;div class="row"&gt;
      &lt;div class="col-md-6"&gt;
        &lt;div class="sponsor-row"&gt;
          &lt;label for="sponsor_input"&gt;&lt;i class="fa fa-tags"&gt;&lt;/i&gt;&lt;/label&gt;
          &lt;input type="text" name="sponsor" id="sponsor_input" class="sponsor-input" placeholder="Sponsor"&gt;&lt;/input&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="col-md-6"&gt;
        &lt;div class="photo-row"&gt;
          &lt;label for="photo_input"&gt;&lt;/label&gt;
          &lt;input type="file" name="photo" id="photo" class="photo-input"&gt;&lt;/input&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My User Model is:</p>
  
  <pre><code>&lt;?php
  </code></pre>
  
  <p>namespace App;</p>
  
  <p>use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;</p>
  
  <p>class User extends Authenticatable
  {
      use Notifiable;</p>
  
  <pre><code>/**
   * The attributes that are mass assignable.
   *
   * @var array
   */
  protected $fillable = [
      'first_name', 'last_name', 'user_name','email', 'password', 'phone', 'location', 'sponsor', 'photo',
  ];
  
  /**
   * The attributes that should be hidden for arrays.
   *
   * @var array
   */
  protected $hidden = [
      'password', 'remember_token',
  ];
  </code></pre>
  
  <p>}</p>
  
  <p>My Migration Code is: </p>
  
  <pre><code>Schema::create('users', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('first_name')-&gt;nullable();
          $table-&gt;string('last_name')-&gt;nullable();
          $table-&gt;string('user_name');
          $table-&gt;string('email');
          $table-&gt;string('password');
          $table-&gt;string('phone');
          $table-&gt;string('location');
          $table-&gt;string('sponsor');
          $table-&gt;binary('photo')-&gt;nullable();
          $table-&gt;text('permissions')-&gt;nullable();
          $table-&gt;timestamp('last_login')-&gt;nullable();
          $table-&gt;timestamps();
  
          $table-&gt;engine = 'InnoDB';
          $table-&gt;unique('email');
      });
  </code></pre>