Пример #1
0
 public function save()
 {
     $email = Input::get('email');
     $password = Hash::make(Input::get('password'));
     $first_name = Input::get('first_name');
     $last_name = Input::get('last_name');
     $phone = Input::get('phone');
     $shopper = Shopper::where('email', $email)->first();
     if ($shopper) {
         return Redirect::to('Apply_Here')->with('error', 'Email ID already Register');
     } else {
         $shopper = new Shopper();
         $shopper->email = $email;
         $shopper->first_name = $first_name;
         $shopper->last_name = $last_name;
         $shopper->password = $password;
         $shopper->phone = $phone;
         $shopper->is_active = 0;
         $shopper->save();
         // Order Placement Mail
         $user = $shopper;
         Mail::send('emails.Apply_Here', array('user' => $user), function ($message) use($user) {
             $message->to($user->email, $user->first_name)->subject('Thanks for signing up as a shopper!');
         });
         return Redirect::to('Apply_Here')->with('success', 'You have been registered successfully. Please wait for the confirmation from our side');
     }
 }
Пример #2
0
 public function save_shopper()
 {
     $id = Input::get('id');
     $shopper = Shopper::find($id);
     if (!$shopper) {
         $shopper = new Shopper();
     }
     $shopper->first_name = Input::get('first_name');
     $shopper->last_name = Input::get('last_name');
     $shopper->phone = Input::get('phone');
     $shopper->email = Input::get('email');
     $shopper->zipcode = Input::get('zipcode');
     if (Input::has('password')) {
         $shopper->password = Hash::make(Input::get('password'));
     }
     $shopper->save();
     $message = "Successfully updated the shopper";
     $type = "success";
     return Redirect::to('/admin/shoppers')->with('type', $type)->with('message', $message);
 }