Call to undefined method Illuminate\Http\JsonResponse::validate() in Laravel 5.3
<p>I am implementing a registration form using JSON post request and laravel 5.3 with the below Controller settings </p>

<pre><code>&lt;?php

namespace App\Http\Controllers\Auth;

use App\User;
use Validator;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\RegistersUsers;


class RegisterController extends Controller
{

use RegistersUsers;

public function __construct()
{
    $this-&gt;middleware('guest');
}

protected function validator(array $data)
{
    $data = $data['Register'];
    $validator = Validator::make($data, [
        'email' =&gt; 'required|email|max:255|unique:users',
        'password' =&gt; 'required|min:6|confirmed',
    ]);

    if($validator-&gt;fails())
    {
        $errors = $validator-&gt;errors()-&gt;all()[0];
        //dd($errors);

        return response()-&gt;json(['errors'=&gt;$errors]);
    }
    else
    {
        return $validator;
    }
}
protected function create(array $data)
{

    $data = $data['Register'];
    //dd($data);
    User::create([
        //'name' =&gt; $data['name'],
        'email' =&gt; $data['email'],
        'password' =&gt; bcrypt($data['password']),
    ]);

    return response()-&gt;json(['success' =&gt; $data['email']], 200);
}
</code></pre>

<p>}</p>

<p>But i want to track server errors in the event of multiple registration with the same email. I have handled this on the client side but in need to handle on the backend too. </p>

<p>The Problem is with the validator function it keep returning below error</p>

<pre><code>FatalThrowableError in RegistersUsers.php line 31:
Call to undefined method Illuminate\Http\JsonResponse::validate() 
</code></pre>

<p>I have checked inside the framework code and there is a validate method which seems to be unrecognized with the json response any ideas?</p>