title: Call to a member function all() on array in laravel
body: <p>I am getting this error:</p>
  <blockquote>
  <p>FatalErrorException in Builder.php line 485:</p>
  <p>Call to a member function all() on array</p>
  </blockquote>
  <p>my register controller</p>
  <pre><code>namespace App\Http\Controllers\Auth;
  
  use App\User;
  use App\Http\Controllers\Controller;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Foundation\Auth\RegistersUsers;
  use Illuminate\Http\Request;
  
  
  class RegisterController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Register Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users as well as their
      | validation and creation. By default this controller uses a trait to
      | provide this functionality without requiring any additional code.
      |
      */
  
      use RegistersUsers;
  
      /**
       * Where to redirect users after registration.
       *
       * @var string
       */
      protected $redirectTo = '/';
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'fullname' =&gt; 'required|max:255',
              'email' =&gt; 'required|email|max:255|unique:users',
              'password' =&gt; 'required|min:6',
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return User
       */
      protected function create(array $data)
      {
          
          return User::create([
              'name' =&gt; $data['fullname'],
              'email' =&gt; $data['email'],
              'password' =&gt; bcrypt($data['password']),
          ]);
      }
  
      /**
       * Handle a registration request for the application.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function register(Request $request)
      {
          $validator = $this-&gt;validator($request-&gt;all());
  
          if ($validator-&gt;fails()) {
              $this-&gt;throwValidationException(
                  $request, $validator
              );
          }
          $user = $this-&gt;create($request-&gt;all());
          
  
          return redirect($this-&gt;redirectPath());
      }
  }
  </code></pre>