コード例 #1
0
 public function store(Request $request)
 {
     $customer_detail = new customerdetail();
     $customer_detail->firstName = Input::get('firstname');
     $customer_detail->lastName = Input::get('lastname');
     $customer_detail->company = Input::get('company');
     $customer_detail->street = Input::get('street');
     $customer_detail->city = Input::get('city');
     $customer_detail->zip = Input::get('zip');
     $customer_detail->state = Input::get('state');
     $customer_detail->country = Input::get('country');
     $customer_detail->telephone = Input::get('telephone');
     $customer_detail->email = Input::get('email');
     //return $customer_detail->firstName;
     $customer_detail->save();
     return view('pages.checkout2');
 }
コード例 #2
0
 /**
  * @param Request $request
  * store customer details
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function store(Request $request)
 {
     $this->validate($request, ['fullname' => 'required|regex:/(^[A-Za-z . ]+$)+/|between:5,40', 'city' => 'required', 'locationtype' => 'required', 'phoneno' => 'required|digits:10', 'address1' => 'required|regex:/(^[A-Za-z0-9 .\\,\\/ ]+$)+/', 'address2' => 'required|regex:/(^[A-Za-z0-9 .\\, ]+$)+/', 'delivery_date' => 'required|date|after:today', 'email' => 'required|']);
     //object creation
     $customer_detail = new customerdetail();
     $customer_detail->fullName = Input::get('fullname');
     $customer_detail->city = Input::get('city');
     $customer_detail->locationType = Input::get('locationtype');
     $customer_detail->phoneNo = Input::get('phoneno');
     $customer_detail->addressLine1 = Input::get('address1');
     $customer_detail->addressLine2 = Input::get('address2');
     $customer_detail->delDate = Input::get('delivery_date');
     $customer_detail->email = Input::get('email');
     $customer_detail->save();
     $deliveryDate = Input::get('delivery_date');
     $address1 = Input::get('address1');
     $address2 = Input::get('address2');
     return view('pages.Cart.checkout2', compact('deliveryDate', 'address1', 'address2'));
 }