title: Set authenticate stuff manually in laravel 5.7
body: <p>I'm working on a <code>laravel 5.7</code> project and I want to have my own authentication scenario.</p>
  
  <p>Well, I'll give a mobile from my user and send her a <code>one time pass</code> to her phone and then check if she is giving me the correct code.</p>
  
  <p>So, I do not use laravel authentication system at this point at all.</p>
  
  <p><strong>My Controller is something like this :</strong></p>
  
  <pre><code>    /*
       * Show Login Form
       */
      public function showLoginForm()
      {
          return view('auth.custom.login');
      }
  
  
      /*
       * Login
       */
      public function login(Request $request)
      {
          $mobile = $request-&gt;mobile;
  
  
          $this-&gt;validate($request, [
              'mobile' =&gt; 'iran_mobile|required'
          ]);
  
          $check = User::where('mobile', $mobile)-&gt;first();
  
          if( $check === null )
          {
              Session::flash('toasterr', 'is not registered yet');
              Session::put('mobile', $mobile);
              return redirect(route('register'));
          }
          else
          {
              $singleTimePass = Str::random(4);
              sendSms($mobile, 'your code:' . PHP_EOL . $singleTimePass . PHP_EOL . 'Insert that bla bla');
              Session::put('singleTimePass', $singleTimePass);
              Session::put('mobile', $mobile);
  
              return redirect(route('check_pass'));
          }
  
          dd($check);
  
      }
  
  
  
      /*
       * Show Check Pass page
       */
      public function showCheckPass()
      {
          return view('auth.custom.pass');
      }
  
  
  
      /*
       * Check Pass For Login
       */
      public function checkPassForLogin(Request $request)
      {
          $this-&gt;validate($request, [
              'pass' =&gt; 'required|regex:/^[\w-]*$/'
          ]);
  
          if( $request-&gt;pass == Session::get('singleTimePass'))
          {
              $user = User::where('mobile', Session::get('mobile'))-&gt;first();
  //            dd($user-&gt;id);
              Auth::login($user-&gt;id);
              return redirect(route('game'));
          }
          else
          {
              Session::flash('toasterr', 'pass is wrong');
              return redirect(route('check_pass'));
          }
      }
  
  
      /*
       * Show Register Form
       */
      public function showRegisterForm()
      {
          return view('auth.custom.register');
      }
  
      /*
       * Register
       */
      public function register(Request $request)
      {
          $this-&gt;validate($request, [
              'name' =&gt; 'persian_alpha|required',
              'family' =&gt; 'persian_alpha|required',
              'username' =&gt; 'required|min:4|max:255|string',
              'mobile' =&gt; 'iran_mobile|required',
          ]);
  
          return $request-&gt;all();
      }
  </code></pre>
  
  <p><strong>Ok!</strong> Every thing seems to be good but now, I expect laravel that give me abilities like <code>Auth::check()</code> or <code>Auth::user()</code> and...</p>
  
  <p>So I know that I have an error at this line: <strong><code>Auth::login($user-&gt;id);</code></strong> and I want to know how can I do something like this manually for mentioned goal.</p>
  
  <p>May be it is because of my poor knowledge about laravel authentication architecture but it would be appreciate if you let me know how do that because googled this for a while and there's not direct answer to this question<code>-or I did not searched enough-</code>.</p>