Guest User

Untitled

a guest
Nov 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. if( Auth::attempt(['mssv' => $username,'password' =>$password])) {
  2. $user=SinhVien::where('mssv',$username)->first();
  3.  
  4. //i want to share $user to all view in here
  5.  
  6. $success = new MessageBag(['successlogin' => 'Login Success]);
  7. return redirect()->back()->withErrors($success);
  8. }
  9. else {
  10. $errors = new MessageBag(['errorlogin' => 'Login Fail']);
  11. return redirect()->back()->withErrors($errors);
  12. }
  13.  
  14. {{$user->name}}
Add Comment
Please, Sign In to add comment