Laravel duplicate email
<p>I've declared in my user migration that a user has to be unique:</p>

<pre><code>$table-&gt;string('email', 30)-&gt;unique();
</code></pre>

<p>But when I make a user for the first time in postmen I receive the following error:</p>

<pre><code>{
  "message": "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'james@gest.com' for key 'user_email_unique' (SQL: insert into `user` (`firstname`, `lastname`, `displayname`, `email`, `phonenumber`, `birthdate`, `profilepicture`, `suspended`, `role_id`, `company_id`, `updated_at`, `created_at`) values (james, egen, james egen, james@gest.com, 0628383493, , , 1, 1, 1, 2016-05-06 13:03:31, 2016-05-06 13:03:31))",
  "code": "23000",
  "status_code": 500,
</code></pre>

<p>When I look into my database the user is made so why does it give me that error?</p>

<p><strong>Controller:</strong></p>

<pre><code>  public function store(Request $request)
    {
        $result = $this-&gt;userRepo-&gt;store($request);

        if (!$this-&gt;userRepo-&gt;store($request) != null) {
            return response()-&gt;json(['message' =&gt; 'Gebruiker is succesvol aangemaakt'], 200);
        }
        return response()-&gt;json(['message' =&gt; $result], 406);
    }
</code></pre>

<p><strong>userRepo:</strong></p>

<pre><code>  public function store(Request $request)
    {
        $validator = $this-&gt;validateUser($request);

        if(!$validator != null)
        {
            $user = new User([
                'firstname'             =&gt; $request-&gt;firstname,
                'lastname'              =&gt; $request-&gt;lastname,
                'displayname'           =&gt; $request-&gt;displayname,
                'email'                 =&gt; $request-&gt;email,
                'phonenumber'           =&gt; $request-&gt;phonenumber,
                'birthdate'             =&gt; $request-&gt;birthdate,
                'profilepicture'        =&gt; $request-&gt;profilepicture,
                'suspended'             =&gt; $request-&gt;suspended,
                'role_id'               =&gt; $request-&gt;role_id,
                'company_id'            =&gt; $request-&gt;company_id
            ]);

            $user-&gt;save();
            return null;
        }
        return $validator;
    }
</code></pre>

<p>I'm using dingo and JWT-Auth. </p>