Ejemplo n.º 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');
     }
 }
Ejemplo n.º 2
0
 public function order_shoppers()
 {
     $id = Input::get('order_id');
     $order = Order::find($id);
     $address = UserAddress::find($order->address_id);
     $shoppers = Shopper::where('zipcode', $address->zipcode)->get()->toArray();
     $response = Response::json($shoppers);
     return $response;
 }