Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( Auth::attempt(['mssv' => $username,'password' =>$password])) {
- $user=SinhVien::where('mssv',$username)->first();
- //i want to share $user to all view in here
- $success = new MessageBag(['successlogin' => 'Login Success]);
- return redirect()->back()->withErrors($success);
- }
- else {
- $errors = new MessageBag(['errorlogin' => 'Login Fail']);
- return redirect()->back()->withErrors($errors);
- }
- {{$user->name}}
Add Comment
Please, Sign In to add comment