本文整理汇总了PHP中app\Location::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::orderBy方法的具体用法?PHP Location::orderBy怎么用?PHP Location::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Location
的用法示例。
在下文中一共展示了Location::orderBy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$locations = Cache::remember('locations', 15, function () {
return Location::orderBy('name')->get();
});
return response()->json(['data' => $locations], 200);
}
示例2: create
public function create()
{
$locations = Location::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
$sub_locations = Sub_location::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
$addresses = Address::orderBy('name_eng', 'asc')->lists('name_eng', 'id');
$car_types = Car_type::select(DB::raw("name_eng || ' (max ' || max_passengers || ' passengers)' AS car_type, id"))->lists('car_type', 'id');
return view('booking.create')->with(['car_types' => $car_types, 'locations' => $locations, 'sub_locations' => $sub_locations, 'addresses' => $addresses]);
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$locations = Location::orderBy('id', 'desc')->get();
return view('locations.index', compact('locations'));
}
示例4: index
/**
* Display a list of all of the locations
*
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
$locations = Location::orderBy('name', 'asc')->get();
return view('locations.index', ['locations' => $locations]);
}
示例5: edit
/**
* Ddit product
*
* @param Request $request
* @return Response
*/
public function edit(Request $request, Product $product)
{
$stores = Store::orderBy('name')->lists('name', 'id');
$locations = Location::orderBy('name')->lists('name', 'id');
$sources = Source::orderBy('name')->lists("name", 'id');
return view('products.input', ['stores' => $stores, 'locations' => $locations, 'sources' => $sources, 'product' => $product, 'product_statuses' => $this->product_statuses]);
}
示例6: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$locations = Location::orderBy('address')->orderBy('number')->get();
return view('locations.index', compact('locations'));
}
示例7: index
public function index()
{
$locations = Location::orderBy('id', 'ASC')->paginate(15);
return view('locations.index', ['locations' => $locations]);
}
示例8: getAllLocations
/**
* @param string $order_by
* @param string $sort
* @return mixed
*/
public function getAllLocations($order_by = 'id', $sort = 'asc')
{
return Location::orderBy($order_by, $sort)->get();
}
示例9: index
public function index()
{
$locations = Location::orderBy('created_at', 'desc')->paginate(20);
return view('locations.index', compact('locations'));
}
示例10: locations
public function locations()
{
$locations = Location::orderBy('created_at', 'desc')->get();
return view('locations.admin', compact('locations'));
}