public function Address()
 {
     if (Auth::check()) {
         $customerId = Auth::user()->id;
         $province = Province::select(["provinceid", "name"])->orderBy("name")->get();
         $district = District::select(["districtid", "name"])->where("provinceid", $province[0]->provinceid)->orderBy("name")->get();
         $ward = Ward::select(["wardid", "name"])->where("districtid", $district[0]->districtid)->orderBy("name")->get();
         $address = CustomerInfo::getAllAddressInfo($customerId);
         return view("pages.paymentInfo.address", compact("province", "district", "ward", "address"));
     } else {
         return redirect()->route("login");
     }
 }
Пример #2
0
 public function CustomerInfo()
 {
     if (Request::ajax()) {
         if (Auth::check()) {
             $customerId = Auth::user()->id;
             $province = Province::select(["provinceid", "name"])->orderBy("name")->get();
             $district = District::select(["districtid", "name"])->where("provinceid", $province[0]->provinceid)->orderBy("name")->get();
             $ward = Ward::select(["wardid", "name"])->where("districtid", $district[0]->districtid)->orderBy("name")->get();
             $address = CustomerInfo::getAllAddressInfo($customerId);
             //danh sach dia chi
             return view("pages.customerInfo.info", compact("province", "district", "ward", "address"));
         }
     } else {
         return redirect()->route("home");
     }
 }