title: login autorization error getting Undefined variable: erros
body: <p>I'm start learning laravel and want to create sample login authorization system on my html template. I watched a tutorial and when i do everything that was in video i get error <code>Undefined variable: erros</code>.
  I'm new and I don't know good PHP but i want to learn while creating a website I know a little.</p>
  
  <p>my rout code is my route code :</p>
  
  <p>this is route for my login code</p>
  
  <pre><code>Route::get ('/main', 'MainController@index');
  Route::get ('/main/checklogin', 'MainController@checklogin');
  Route::get ('/main/successlogin', 'MainController@successlogin');
  Route::get ('/main/logout', 'MainController@logout');
  </code></pre>
  
  <p>1.my login code </p>
  
  <pre><code>    &lt;div class="login slide-up"&gt;
          &lt;div class="center"&gt;
  
              &lt;h2 class="form-title" id="login"&gt;&lt;span&gt;sign&lt;/span&gt;in&lt;/h2&gt;
               @if (isset(Auth::user()-&gt;email))
              &lt;script&gt;window.location="/main/successlogin"&lt;/script&gt;
              @endif 
  
              @if ($message = Session::get('error'))
              &lt;div class ="alert alert-danger alert-block"&gt;
              &lt;button type="button" class="close" data-dismiss="alert"&gt;X&lt;/button&gt;
              &lt;strong&gt;{{$message}}&lt;/strong&gt;
              @endif
              &lt;form method="get" action="{{   url('/main/checklogin')
              }}"&gt;
              @if(count($errors)  &gt;0 )
              &lt;div class="alert alert-danger"&gt;
              &lt;ul&gt;
              @foreach($erros-&gt;all() as $error)
              &lt;li&gt;{{ $error }}&lt;/li&gt;
              @endforeach
              &lt;/ul&gt;
              &lt;/div&gt;
              @endif
              &lt;form method="get" action="{{   url('/main/checklogin')
              }}"&gt;
              {{ csrf_field()}} 
              &lt;div class="form-holder"&gt;
                  &lt;input type="email" class="input" placeholder="email" /&gt;
                  &lt;input type="password" class="input" placeholder="password" /&gt;
              &lt;/div&gt;
              &lt;button class="submit-btn"&gt;Sign in&lt;/button&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>2.my successlogin code </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  @if (issets(auth::user()-&gt;email))
  &lt;p&gt;gamarjoba {{Auth::user()-&gt;email}}}&lt;/p&gt;
  &lt;a href="{{ url('/main/logout') }}" &gt; logout &lt;/a&gt;
  
  else
  
  &lt;script&gt;windows.location = "/main";   &lt;/script&gt;
  
  @endif
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my main controller</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Validator;
  use Auth;
  
  class MainController extends Controller
  {
      function index()
      {
  
      return view('front/login');
  
      }
  
      function checklogin(Request $request)
  
      {
  
          $this-&gt;validate($request, [
              'email'         =&gt;  'required|email',
              'password'       =&gt;  'required|alphaNum|min:4'
          ]);
              $user_data = array(
  
                  'email'         =&gt; $request -&gt; get('email'),
                  'password'      =&gt; $request -&gt; get('password')
              );
  
              if (Auth::attempt($user_data))
              {
  
                  return redirect('main/successlogin');
  
              }
              else
              {
  
              return back()-&gt;with('error', 'wrong Login Details');
  
              }
  
      }
  
      function successlogin()
      {
  
          return view('successlogin');
  
      }
  
  
      function logout()
      {
  
          Auth::logout();
          return redirect('main');
      }
  
  }
  </code></pre>