title: Laravel 5.1 BadMethodCallException in Controller.php line 283 Method [create] does not exist
body: <p>I want to create user by using social authentication like Facebook authentication and I followed this tutorial <a href="https://www.youtube.com/watch?v=NZWJCoXN6Us&amp;list=PLpRNkmPv_dKHoicxrsB8QVMYjeKoEiCWK&amp;index=24" rel="nofollow">Socialite Authentication in Laravel 5.1</a> from youtube.</p>
  
  <p>After using this tutorial I got an Exception which is </p>
  
  <pre><code>BadMethodCallException in Controller.php line 283:
    Method [create] does not exist.
  
    in Controller.php line 283
    at Controller-&gt;__call('create', array(array('name' =&gt; null, 'email' =&gt;    'abdur.razzaq06@gmail.com', 'password' =&gt; '4dbf14f26a97584375b7b2c84b6a4786cb1b4a43'))) in SocialAuthController.php line 84
    at SocialAuthController-&gt;create(array('name' =&gt; null, 'email' =&gt; 'abdur.razzaq06@gmail.com', 'password' =&gt; '4dbf14f26a97584375b7b2c84b6a4786cb1b4a43')) in SocialAuthController.php line 84
    at SocialAuthController-&gt;github_Callback()
    at call_user_func_array(array(object(SocialAuthController), 'github_Callback'), array()) in Controller.php line 256
    at Controller-&gt;callAction('github_Callback', array()) in ControllerDispatcher.php line 164
    at ControllerDispatcher-&gt;call(object(SocialAuthController), object(Route), 'github_Callback') in ControllerDispatcher.php line 112
    at ControllerDispatcher-&gt;Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
    at Pipeline-&gt;Illuminate\Pipeline\{closure}(object(Request))
  </code></pre>
  
  <p>What can I do to fix it?</p>
  
  <p>Here is my code:</p>
  
  <p>app\routes.php</p>
  
  <pre><code>// facebook Sociolite
     Route::get('/auth/facebook', 'Auth\SocialAuthController@redirectToProvider');
     Route::get('callback_facebook', 'Auth\SocialAuthController@handleProviderCallback');
  </code></pre>
  
  <p>App\Http\Auth|SocialAuthController.php</p>
  
  <pre><code>  &lt;?php
  
         namespace App\Http\Controllers\Auth;
  
         use Illuminate\Http\Request;
         use App\Http\Requests;
         use App\Http\Controllers\Controller;
         use Illuminate\Foundation\Auth\ThrottlesLogins;
         use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
         use Illuminate\Foundation\Validation\ValidatesRequests;
  
         use App\User;
         use Validator;
  
       //use ValidatesRequests;
         use Socialite;
         use Auth;
         use redirect;
  
         class SocialAuthController extends Controller
         {   
               // For Facebook
                public function redirectToProvider(){
  
                       return Socialite::driver('facebook')-&gt;redirect();
                }
  
                public function handleProviderCallback(){
  
                       $curl = curl_init();
                       curl_setopt($curl , CURLOPT_SSL_VERIFYPEER, false);
  
                       $user = Socialite::driver('facebook')-&gt;user();
                       $data = ['name'=&gt;$user-&gt;name, 'email'=&gt;$user-&gt;email, 'password'=&gt;$user-&gt;token];
  
                       $userDB = User::where('email',$user-&gt;email)-&gt;first();
  
  
                       if (!is_null($userDB)){
                             Auth::login($userDB);
                       }
                       else{
                            Auth::login($this-&gt;create($data)); // line 84
                         // Auth::login($this-&gt;data($data));
                       }
                 return redirect('/pages/profile');
                 }
  
           }
  </code></pre>
  
  <p>vendor/laravel/framework/src/Illuminate/Routing/Controller.php</p>
  
  <pre><code>     &lt;?php
  
            namespace Illuminate\Routing;
  
            use Closure;
            use BadMethodCallException;
            use Illuminate\Support\Str;
            use InvalidArgumentException;
            use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  
            abstract class Controller
            {
                  public function __call($method, $parameters)
                  {
                         throw new BadMethodCallException("Method [$method] does not exist."); // line 283
                  }
            }
  </code></pre>