/** * Display a listing of the resource. * * @return Response */ public function getConfig() { if (Payment::VeryPayment() == false) { return View::make('clinic.payment.renews-payment'); } $user = Sentry::getUser(); $clinic = Clinic::where('user_id', $user->id)->first(); $adress = Address::find($clinic->address_id); $province_id = City::find($adress->city_id)->province_id; $country_id = Province::find($province_id)->country_id; $option = $clinic->insurances; #$option = Option::where('name', $clinic->id.'-clinic-insurance')->first(); $array = array(); if ($option) { $segs = explode(',', $option); $segok = ''; foreach ($segs as $seg) { $very = Insurance::where('id', $seg)->first(); if ($very) { $array[] = array('value' => $very->id, 'text' => $very->name); } } } /**/ $optionLang = Option::where('name', $clinic->id . '-clinic-lang')->first(); if (!$option) { return View::make('clinic.config.config')->with('country_id', $country_id)->with('clinic', $clinic)->with('adress', $adress); } else { return View::make('clinic.config.config')->with('clinic', $clinic)->with('option', $array)->with('adress', $adress)->with('country_id', $country_id)->with('optionLang', $optionLang); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->province->find($id)->delete(); return Redirect::route('provinces.index'); }