title: Laravel how to insert random password automatically
body: <p>With Laravel 5.4, I have users table</p>
  
  <pre><code>Users table:
  - id
  - email
  - password
  - created_at
  - updated_at
  </code></pre>
  
  <p>then when I insert new user data, I want to generate random password (like 9c41Mr2) automatically.</p>
  
  <p>For example, once I insert one data:</p>
  
  <pre><code>$data = [
      'email' =&gt; 'test@example.com',
  ];
  
  DB::table('users')-&gt;insert($data);
  </code></pre>
  
  <p>I want new row in MySQL like this:</p>
  
  <pre><code>id: 1 (generated by autoincrement)
  email: test@example.com
  password: 9c41Mr2 (wow! automatic!)
  created_at: 2017-06-14 01:00:00
  updated_at: 2017-06-14 01:00:00
  </code></pre>
  
  <p>so, could anyone tell me the best way in Laravel? Thanks.</p>
  
  <p>PS: don't worry about password hashing, I made my question simple.</p>