public function forgetPass()
 {
     $emails = Input::get('email');
     $email = $emails . "*manual";
     $checkmail = UserLoginModel::where('user_email', '=', $email)->first();
     if ($checkmail) {
         $pass = $checkmail->password;
         $mail = new \PHPMailer();
         $mail->IsSMTP();
         $mail->SMTPAuth = true;
         $mail->Host = "smtp.gmail.com";
         $mail->Port = 465;
         $mail->Username = "******";
         $mail->Password = "******";
         $mail->SMTPSecure = 'ssl';
         $mail->SetFrom('*****@*****.**', 'Mobile a Muktijuddho');
         $mail->Subject = "Mobile a muktijuddho pin";
         $mail->Body = "Dear " . $checkmail->user_name . "," . "\n\n your password is" . $pass;
         $address = $emails;
         $mail->AddAddress($address, $checkmail->user_name);
         try {
             $mail->Send();
             return Response::json(array('status' => 1, 'message' => null));
         } catch (\Illuminate\Database\QueryException $e) {
             return Response::json(array('status' => 0, 'message' => $e->getMessage()));
         }
     } else {
         return Response::json(array('status' => 0, 'message' => 'email not found'));
     }
 }
 public function Authentication()
 {
     $user_id = Input::get('user_id');
     $check = UserLoginModel::where('id', '=', $user_id)->exists();
     if (!$check) {
         return Response::json(array('status' => 'fail'));
     }
     $location = Input::get('location');
     $nowDateod = Carbon::now('Asia/Dhaka');
     $nowDate = $nowDateod->toDateString();
     $special_date_explode = explode("-", $nowDate);
     $postDateob = Carbon::now()->addWeeks(1);
     $postDate = $postDateob->toDateString();
     $check = LocationAuthorizationModel::where('user_id', '=', $user_id)->where('location', '=', $location)->first();
     if ($check) {
         $onePlay = SpecialDate::where('id', '=', $check->special_id_date)->exists();
         $res_date = $check->quiz_res_date;
         $special = $this->specialdate($location, $nowDate, $user_id, $postDate);
         if ($nowDate > $res_date || $special) {
             if ($onePlay) {
                 return Response::json(array('status' => 'fail'));
             }
             return Response::json(array('status' => 'success'));
         } else {
             return Response::json(array('status' => 'fail'));
         }
     } else {
         $checkdate = SpecialDate::where('date', '=', $special_date_explode[2])->where('month', '=', $special_date_explode[1])->where('location', '=', $location)->first();
         $insert = new LocationAuthorizationModel();
         $insert->user_id = $user_id;
         $insert->location = $location;
         $insert->quiz_play_date = $nowDate;
         $insert->quiz_res_date = $postDate;
         if ($checkdate) {
             $insert->special_id_date = $checkdate->id;
         }
         if ($insert->save()) {
             return Response::json(array('status' => 'success'));
         }
     }
 }
 public function update_status($email)
 {
     $updateLoginStatus = UserLoginModel::where('user_email', '=', $email)->update(['user_active_status' => 1]);
 }