title: Lumen PHP: hidden password field in model not filled using Model->fill()
body: <p>I have been having issues with my user signup code of my API I am working on.</p>
  
  <p>I have a UserController that takes the posted data and validates the fields. Then it will send the data to the SignUpUser method in my UserService class that makes a user model and fill in all the given data and send it to the UserRepository that sends it to my DB.</p>
  
  <p>When I <code>dd()</code> my <code>$password</code> it's filled but when I <code>dd()</code> my filled in <code>$user</code> the field return null... I have no idea why it has not filled it in yet.</p>
  
  <p>Screenshots of my code:</p>
  
  <p>UserController</p>
  
  <pre><code>public function signUpUser(Request $request)
  {
      $this-&gt;validate($request,[
          'username' =&gt; 'required|regex:/^[(a-zA-Z\s)(0-9\s)]+$/u|min:3',
          'email' =&gt; 'required|email',
          'password' =&gt; 'required|min:8',
          'displayname' =&gt; 'required|regex:/^[(a-zA-Z\s)(0-9\s)]+$/u|min:3',
      ], [
          'min' =&gt; 'The :attribute must at least be :min characters long.',
      ]);
  
      $user = $this-&gt;userService-&gt;signUpUser(
          $request-&gt;get('username'),
          $request-&gt;get('email'),
          $request-&gt;get('password'),
          $request-&gt;get('displayname')
      );
  
  
  
      if($user)
      {
          //alright! user has been made
          $response = ['status' =&gt; 'OK', 'message' =&gt; "User {$user-&gt;username} has successfully been created"];
      }
      else
      {
          //something went wrong
          $response = ['status' =&gt; 'FAIL', 'message' =&gt; "Something went wrong or user already exists in DB"];
      }
  
      return response()-&gt;json($response, 201);
  }
  </code></pre>
  
  <p>UserService</p>
  
  <pre><code>public function signUpUser($userName, $email, $password, $displayName)
  {
      $password = password_hash($password, PASSWORD_DEFAULT);
  
      $user = $this-&gt;userRepository-&gt;signUpNewUser($userName, strtolower($email), $password, $displayName);
      $user = $this-&gt;userRepository-&gt;get($user-&gt;pk);
      //TODO: send user signup mail soon
      return $user;
  }
  </code></pre>
  
  <p>UserRepository</p>
  
  <pre><code>public function signUpNewUser($username, $email, $password, $displayName)
  {
      $user = $this-&gt;getModel();
      $user-&gt;fill(
          [
              'username' =&gt; $username,
              'email' =&gt; $email,
              'password' =&gt; $password,
              'displayname' =&gt; $displayName,
          ]);
      dd($user::all());
      $user-&gt;save();
      return $user;
  }
  </code></pre>
  
  <p>UserModel</p>
  
  <pre><code>class UserModel extends BaseModel
  {
  
  /**
   * The database table used by the model.
   *
   * @var string
   */
  protected $table = 'users';
  
  
  /**
   * The attributes that are mass assignable.
   *
   * @var array
   */
  protected $fillable = [
  'username', 'email', 'displayname'
  ];
  
  /**
   * The attributes excluded from the model's JSON form.
   *
   * @var array
   */
  protected $hidden = [
      'password',
  ];
  }
  </code></pre>
  
  <p>Dumped $user after filling in data
  <a href="https://i.stack.imgur.com/Bv1fp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bv1fp.png" alt="Dumped $user after filling in data"></a></p>