/**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     $a = array('email' => $request->input('email', 'email not found'), 'password' => $request->input('password', 'password not found'));
     $b = $request->all();
     if ($this->auth->attempt($a)) {
         $ownedBookList = DB::select('SELECT * FROM ownedbooklist where userId = ?;', [13]);
         return redirect('userhomepage');
     }
     \Log::info("login failed");
     return redirect('auth/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }
Example #2
0
 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     \Log::info("-----------------this is f*****g working driver auth controller.php");
     $a = array('email' => $request->input('email', 'email not found'), 'password' => $request->input('password', 'password not found'));
     //   $tasks = DB::select('SELECT * FROM tasks where user_id = 6;');
     //    \Log::info($tasks);
     \Log::info("trying to attepm to loging");
     \Log::info($a);
     $b = $request->all();
     \Log::info("all fields are");
     \Log::info($b);
     if ($this->auth->attempt($a)) {
         \Log::info('.............log in successful.........');
         $ownedBookList = DB::select('SELECT * FROM ownedbooklist where userId = ?;', [13]);
         \Log::info($ownedBookList);
         \Log::info('sending date to view');
         //    return redirect('user/login')->with('message', 'Login Failed');
         return redirect('user/userhomepage');
     }
     /*   if ($this->auth->attempt($request->only('email', 'password')))
             {
                 return redirect('/tasks');
             }
     
         */
     \Log::info("login failed");
     return redirect('auth/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }