本文整理汇总了PHP中app\models\Location::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::lists方法的具体用法?PHP Location::lists怎么用?PHP Location::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Location
的用法示例。
在下文中一共展示了Location::lists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the Tracking.
*
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
$this->trackingRepository->orderBy('id', 'desc')->pushCriteria(new RequestCriteria($request));
$location_id = $request->location_id;
if (empty($location_id)) {
$trackings = $this->trackingRepository;
} else {
$trackings = $this->trackingRepository->locatedAt($location_id);
}
$trackings = $trackings->with('location')->with('billboardOwner')->with('product')->with('brand')->with('facing')->with('user')->paginate(25);
$locations = Location::lists('city', 'id');
return view('trackings.index')->with('trackings', $trackings)->with('locations', $locations)->with('location_id', $location_id);
}
示例2: edit
/**
* Show the form for editing the specified Billboard.
*
* @param int $id
*
* @return Response
*/
public function edit($id)
{
$billboard = $this->billboardRepository->findWithoutFail($id);
$billboard_owners = BillboardOwner::lists('name', 'id');
$locations = Location::lists('city', 'id');
if (empty($billboard)) {
Flash::error('Billboard not found');
return redirect(route('billboards.index'));
}
return view('billboards.edit', compact('billboard', 'billboard_owners', 'locations'));
}