Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function verifyAdmin($where){
- $admin = AdminModel::where($where)->get();
- if($admin->isEmpty()){
- $emptyArray=array();
- return $emptyArray;
- }else{
- return $admin;
- }
- }
- public function adminLogin(AdminLoginRequest $request)
- {
- $adminModel = new AdminModel();
- $email=$request->email;
- $password=$request->password;
- $where=array('email'=>$email,'password'=>md5($password));
- $getUser=$adminModel->verifyAdmin($where);
- if(!empty($getUser)){
- session()->put('email',$email);
- return redirect('admin-dashboard');
- }else{
- return redirect('admin')->with('error', 'Invalid email or password !');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement