本文整理汇总了PHP中app\Country::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::orderBy方法的具体用法?PHP Country::orderBy怎么用?PHP Country::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Country
的用法示例。
在下文中一共展示了Country::orderBy方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* 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);
}
示例2: edit
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'));
}
示例3: edit
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'));
}
示例4: create
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]);
}
示例5: populateDropdowns
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);
}
示例6: getBackground
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);
}
示例7: all
/**
* Returns a collection with all countries.
*
* @return Collection
*/
public function all()
{
return Country::orderBy('name')->get();
}
示例8: getCountry
public function getCountry()
{
$country = Country::orderBy('created_at', 'desc')->paginate(10);
//$posts=Post::orderBy('created_at','desc')->paginate(15);
return view('country', ['country' => $country]);
}
示例9: settings
public function settings()
{
$platforms = \App\Platform::all();
$countries = \App\Country::orderBy('name', 'asc')->get();
return view('user/settings', compact('platforms', 'countries'));
}
示例10: getAllCountries
public function getAllCountries()
{
return Country::orderBy('country_name')->get();
}
示例11: edit
/**
* 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'));
}
示例12: show
/**
* 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]);
}
示例13: countries
public function countries()
{
$countries = Country::orderBy('country_code', 'asc')->get();
return view('scrapers.countries')->with(['countries' => $countries]);
}