daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function store(Request $request)
  2.     {
  3.      
  4.  
  5.         $this->validate($request,
  6.                           ['username'=>'required'],
  7.                           ['password'=>'required']
  8.                        );
  9.  
  10.         $user = $request->input('username');
  11.         $pass = Crypt::encryptString($request->input('password'));
  12.        
  13.  
  14.         $users = DB::table('admin')->where(['nama'=>$user, 'password'=>$pass])->first();
  15.         if(count($users)==0){
  16.  
  17.            return redirect('/')->with('failed','Login gagal');
  18.  
  19.         } else
  20.        
  21.         if($user == $users->nama AND $pass == $users->password ){
  22.            
  23.             return redirect('/admin');  
  24.  
  25.         } else {
  26.              
  27.              return redirect('/')->with('failed','Login gagal');
  28.  
  29.         }
  30.  
  31.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top