/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $countries = Cache::remember('countries', 15, function () { return Country::orderBy('name')->get(); }); return response()->json(['data' => $countries], 200); }
public function edit($id) { $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all(); $categories = Category::lists('category', 'category')->all(); $competition = Competition::whereId($id)->firstOrFail(); return view('backend.competitions.edit', compact('competition', 'countries', 'categories')); }
public function edit($id) { $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all(); $clubs = Club::orderBy('name', 'asc')->get()->lists('name_town', 'id')->all(); $competitor = Competitor::whereId($id)->firstOrFail(); return view('backend.competitors.edit', compact('competitor', 'countries', 'clubs')); }
public function create(ApplicationRequest $request) { $services = Service::join('service_visas', 'services.id', '=', 'service_visas.service_id')->select('services.id', 'services.name', 'min_process', 'max_process')->orderBy('min_process')->orderBy('max_process')->where('country_id', '=', $request->get('country'))->groupBy('services.id')->get(); $service = $services->first(); $states = DB::table('states')->orderBy('name', 'asc')->lists('name', 'id'); $countries = Country::orderBy('name')->lists('name', 'id'); $country = Country::find($request->get('country')); return View('apply', ['services' => $services->lists('title', 'id'), 'service' => $service, 'country' => $country, 'countries' => $countries, 'states' => $states]); }
public function populateDropdowns() { $populatecountry = Country::orderBy('created_at', 'asc')->paginate(100); $populatemunicipality = Municipality::orderBy('created_at', 'asc')->paginate(100); $populateregion = Region::orderBy('created_at', 'asc')->paginate(100); $populateschool_level = School_level::orderBy('created_at', 'asc')->paginate(100); $populateschool_type = School_type::orderBy('created_at', 'asc')->paginate(100); $populateacademic_year = Academic_year::orderBy('created_at', 'asc')->paginate(100); $populatetemplate = Template::orderBy('created_at', 'asc')->paginate(100); $site_code = Settings::first()->site_code; $site_title = Settings::first()->site_title; $owner = Settings::first()->owner; $street = Settings::first()->street; $barangay = Settings::first()->barangay; $zip_code = Settings::first()->zip_code; $contact = Settings::first()->contact; $fax = Settings::first()->fax; $tin = Settings::first()->tin; //$posts=Post::orderBy('created_at','desc')->paginate(15); //return view('general-settings',['populatecountry' => $populatecountry]); return view('general-settings')->with('populatecountry', $populatecountry)->with('populatemunicipality', $populatemunicipality)->with('populateregion', $populateregion)->with('populateschool_level', $populateschool_level)->with('populateschool_type', $populateschool_type)->with('populateacademic_year', $populateacademic_year)->with('populatetemplate', $populatetemplate)->with('site_code', $site_code)->with('site_title', $site_title)->with('owner', $owner)->with('street', $street)->with('barangay', $barangay)->with('zip_code', $zip_code)->with('contact', $contact)->with('fax', $fax)->with('tin', $tin); }
public function getBackground(Request $request) { $num = $request->has("rows") ? Input::get("rows") : 25; $sort = $request->has("sort") ? Input::get("sort") : 'id'; $order = $request->has("order") ? Input::get("order") : 'asc'; $filterRules = $request->has("filterRules") ? Input::get("filterRules") : null; $filterRules = json_decode($filterRules, 1); $pages = Country::orderBy($sort, $order); if (!is_null($filterRules)) { foreach ($filterRules as $item) { if ($item['op'] == 'contains') { $pages = $pages->where($item['field'], 'like', '%' . $item['value'] . '%', "and"); } } } $pages = $pages->paginate($num); //var_dump($pages->toArray()); $data = $pages->toArray(); $result = array(); $result["total"] = $data['total']; $result["rows"] = $data['data']; return json_encode($result); }
/** * Returns a collection with all countries. * * @return Collection */ public function all() { return Country::orderBy('name')->get(); }
public function getCountry() { $country = Country::orderBy('created_at', 'desc')->paginate(10); //$posts=Post::orderBy('created_at','desc')->paginate(15); return view('country', ['country' => $country]); }
public function settings() { $platforms = \App\Platform::all(); $countries = \App\Country::orderBy('name', 'asc')->get(); return view('user/settings', compact('platforms', 'countries')); }
public function getAllCountries() { return Country::orderBy('country_name')->get(); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit() { // $gender = Gender::lists('gender', 'id'); $age = Age::lists('age', 'id'); $occupation = Occupation::lists('occupation', 'id'); $country = Country::orderBy('country')->lists('country', 'id'); //for alphabetic order $education = Education::lists('education', 'id'); //return Auth::User()->profile; return view('user.edit', compact('gender', 'age', 'occupation', 'country', 'education')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(Request $request, $id) { $visa = Visa::findOrFail($id); $countries = Country::orderBy('name')->get(); return view("admin.visa_show", ["visa" => $visa, "countries" => $countries]); }
public function countries() { $countries = Country::orderBy('country_code', 'asc')->get(); return view('scrapers.countries')->with(['countries' => $countries]); }