本文整理汇总了PHP中app\models\City::all方法的典型用法代码示例。如果您正苦于以下问题:PHP City::all方法的具体用法?PHP City::all怎么用?PHP City::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\City
的用法示例。
在下文中一共展示了City::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$place = Place::with(['city', 'category'])->whereId($id)->first();
$categories = Category::all();
$cities = City::all();
return view('client.placeinfo', compact('place', 'categories', 'cities'));
}
示例2: allCity
public function allCity()
{
$response = array();
$infos = City::all();
if (!empty($infos)) {
foreach ($infos as $info) {
$response[] = array("info_id" => $info['id'], "data_description" => $info['city']);
}
}
return $response;
}
示例3: getReceiverinfo
public function getReceiverinfo (Request $request)
{
$user = Auth::user();
$receiverInfoSet = ReceiverInfo::where('uid', '=', $user->id)
->where('active', '=', '1')
->orderBy('last_used', 'desc')
->orderBy('created_at', 'desc')
->get();
$provinceSet = Province::all();
$provinces = array();
foreach ($provinceSet as $province) {
array_push($provinces, $province);
}
$cities = City::all();
$districts = array();
foreach ($cities as $city) {
$district = District::where('city_code', '=', $city->code)
->where('active', '=', '1')
->first();
if ($district) {
array_push($districts, $district);
}
}
$receiverInfos = array();
foreach ($receiverInfoSet as $receiverInfo) {
array_push($receiverInfos, $receiverInfo);
}
$data = [
'receiverInfos' => $receiverInfos,
'provinces' => $provinces,
'cities' => $cities,
'districts' => $districts,
'receiverActive' => true,
'wTitle' => '个人中心 - 收货人信息'
];
return view('profile/receiver_info', $data);
}
示例4: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$cities = City::all();
return view('admin.city', compact('cities'));
}
示例5: index
public function index()
{
return view('admin.cities.list', array('cities' => City::all()));
//return view('admin.cities.list');
}
示例6: show
public function show()
{
$cityCollection = City::all();
return response()->json($cityCollection);
}