1 week ago

Issue about an error

Posted 1 week ago by rubenochoa

Hi. Something wrong happens. I get no error while i am trying just to submit sign in.

At usercontroller

 if (Auth::attempt(['email' => $request->input('email'), 'password' => $request->input('password')])){
            $user = User::where('email', '=', Input::get('email'))->first();
                if ($user === null) {
                    $request->session()->flash('usernotexist', 'User does not exist!');
                    return back();
               else if (User::where('email', '=', Input::get('email'))->exists()) {
                    $request->session()->flash('userexist', 'User exist');
                    return back();
             $remember_me = $request->has('remember_me') ? true : false; 
                $oldUrl = Session::get('oldUrl');
                return redirect()->to(Session::get('oldUrl'));
            return redirect()->route('product.index');
        return redirect()->back();


  <div class="form">
    <form action="">
      <h1>Sign in</h1>
      @if(count($errors) > 0)
    <div class="alert alert-danger">
        @foreach ($errors->all() as $error)
        <p>{{ $error }}</p>
    <div class="alert alert-success">
        {{ session('success')}}
    <div class="alert alert-danger">
        {{ session('error')}}
    <div class="alert alert-success">
        {{ session('userdelete')}}
         @if (Session::has('usernoexist'))
            <div class="alert alert-danger  text-center">
               <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
                <p>{{ Session::get('no_user') }}</p>
    <form action="{{ route('user.signin') }}" method="post">
      <input type="email" name="" id="email" placeholder="Enter email"><br>
      <input type="password" name="" id="password" placeholder="Enter password"><br>
      <input type="checkbox" onclick="confirmfunction()">Show Password
                function confirmfunction() {
                    var x = document.getElementById("password");
                    if (x.type === "password") {
                      x.type = "text";
                    } else {
                      x.type = "password";
      <input type="submit" value="Sign In" value="Sign in" class="signin"> <br>
      {{ csrf_field() }}<br><br>        
          <label for="remember_me">
              <input type="checkbox" name="remember_me" id="remember_me" value="1">Remember Me
      <p><a href="{{ route('password.request')}}">Forget password?</a></p><hr>
      <p class="signup">Do not have an account? <a href="{{ route('user.signup') }}">Sign up instead!</p>

Please sign in or create an account to participate in this conversation.