public function postIndex() { District::create(Input::all()); return Redirect::back()->with('status', 'District Added!'); }
private function getExistingHomeTeacherCompanionData($existingHomeTeachers) { $existingHomeTeacherCompanion = []; foreach ($existingHomeTeachers as $key => $homeTeachers) { $existingHomeTeacherCompanion[$key]['homeTeacher'][1] = Member::find($homeTeachers->ht_one_id); $existingHomeTeacherCompanion[$key]['homeTeacher'][2] = Member::find($homeTeachers->ht_two_id); $families = CompanionshipFamily::where('companionship_id', '=', $homeTeachers->id)->get(); $existingHomeTeacherCompanion[$key]['families'] = []; foreach ($families as $family) { $taughtFamily =& $existingHomeTeacherCompanion[$key]['families'][]; $taughtFamily = Member::find($family->member_id); $taughtFamily['ward_companionship_member_id'] = $family->id; } $district = District::find($homeTeachers->district_id); if ($district) { $existingHomeTeacherCompanion[$key]['districtMember'] = Member::find($district->member_id); } } return $existingHomeTeacherCompanion; }
public function address_content(Request $request) { $usermeta = UserMeta::where('user_id', Sentinel::getUser()->id)->where('meta_key', 'address')->first(); $address = unserialize($usermeta->meta_value); $this->data['address'] = $address[$request->id]; $this->data['province'] = Province::where('id', $this->data['address']['provinsi'])->first(); $this->data['district'] = District::where('id', $this->data['address']['kecamatan'])->first(); $this->data['city'] = City::where('id', $this->data['address']['kota'])->first(); $this->data['weight'] = $request->weight; $costs = app('App\\Http\\Controllers\\OrderController')->get_cost($this->data['address']['kota']); $cost = json_decode($costs); $this->data['cost_data'] = serialize($cost->rajaongkir->results[0]->costs); return view('address_content')->with('data', $this->data); }
public function district_content(Request $request) { $this->data['district_data'] = District::where('id_city', $request->id)->get(); return view('district_content')->with('data', $this->data); }