laravel Auth ::登录登录无效

时间:2016-10-13 09:59:18

标签: php laravel laravel-5 laravel-5.2 laravel-5.1

这是我尝试登录的代码,但是它不起作用,数据在此之前出现但是错误在于 - > Auth::login($user1); 虽然如果我将Auth::login($user1);置于if()条件下,它会进入内部但不会重定向,如果条件,

if(count($staff) > 0)
{
  $staff['0']['type']='staff';
  $staff['0']['name']=$staff['0']['emp_name'];

  unset($staff['0']['emp_name']);
  Session::put('user',$staff['0']);

  $id= $staff[0]['id'];

  $user1 = Staff::find($id);
  //print_r($user);exit;
  //return Auth::login($user);
  Auth::login($user1);

  return redirect()->intended('/student');
}

0 个答案:

没有答案