本文整理匯總了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);
}