title: create registration with slim and eloquent
body: <p>Controller register method:</p>
  
  <pre><code>public function register($request, $response)
  {       
  $user = User::create([
      'username'=&gt; $request-&gt;getParsedBody()['username'],
      'password'=&gt; $request-&gt;getParsedBody()['password'],
      'nama'=&gt; $request-&gt;getParsedBody()['nama'],
      'no_hp'=&gt; $request-&gt;getParsedBody()['no_hp'],
      ]);
  
  return $response-&gt;withJson([
      'succes' =&gt;true , 
      'message'=&gt;'Pendaftaran Berhasil',
      'data'   =&gt; $user
      ]);
  }
  </code></pre>
  
  <p>User model code:</p>
  
  <pre><code>&lt;?php
  namespace App\models;
  use Illuminate\Database\Eloquent\Model;
  class User extends Model 
  {
      public   $timestamps  = false;
      protected $fillable = ['username', 'password', 'nama', 'no_hp'];
      protected $table    = "users";
  }
  </code></pre>
  
  <p>how can I check if username is already exist in database?</p>
  
  <p>I use slim and eloquent</p>