当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::with方法代码示例

本文整理汇总了PHP中app\Location::with方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::with方法的具体用法?PHP Location::with怎么用?PHP Location::with使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Location的用法示例。


在下文中一共展示了Location::with方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     // $locations = Location::all();
     // return view('locations',['locations'=>$locations]);
     $locations = Location::with('stories')->get();
     return view('locations', ['locations' => $locations]);
 }
开发者ID:annievuvu,项目名称:Programming-Assignments,代码行数:7,代码来源:LocationController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $state = \Input::get('state');
     $county = \Input::get('county');
     $location = \App\Location::with('products')->where(['state' => $state, 'county' => $county])->firstOrFail();
     $products = $location->products;
     return view('products.index', compact('location', 'products'));
 }
开发者ID:baudday,项目名称:sagar,代码行数:13,代码来源:ProductsController.php

示例3: search

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function search(Request $request)
 {
     if ($request->input('term')) {
         $locations = Location::with('latestPrice')->where('address', 'like', $request->input('term') . '%')->orderBy('address')->orderBy('number')->get();
         $search = true;
     } else {
         $locations = Location::with('latestPrice')->orderBy('address')->orderBy('number')->get();
         $search = false;
     }
     return response()->json(["status" => "OK", "search" => $search, "data" => $locations]);
 }
开发者ID:elconejito,项目名称:RabbitHome,代码行数:16,代码来源:LocationController.php

示例4: dashboard

 public function dashboard()
 {
     $today = Carbon::today('Europe/Brussels');
     $now = Carbon::now('Europe/Brussels');
     $clients = Client::where('leavetime', '=', null)->get();
     $clientsWithTable = collect([]);
     foreach ($clients as $client) {
         if ($client->table != null) {
             $clientsWithTable->push($client);
         }
     }
     foreach ($clientsWithTable as $client) {
         if (count($client->orders) > 0) {
             $order = $client->orders()->where('endtime', '=', null)->first();
             if ($order) {
                 $client->wait_time = $now->diffInMinutes(Carbon::createFromFormat('Y-m-d H:i:s', $order->starttime));
             }
         }
     }
     $areas = ['' => 'Gebieden'] + Area::orderby('name', 'ASC')->lists('name', 'id')->all();
     $locations = Location::with('table')->with('decoration')->get();
     return View::make('dashboard')->with('today', $today)->with('clientsWithTable', $clientsWithTable)->with('areas', $areas)->with('locations', $locations);
 }
开发者ID:jimpeeters,项目名称:ProjectInternetOfThings,代码行数:23,代码来源:MainController.php

示例5: index

 public function index()
 {
     $location = Location::with('storys')->get();
     //$location = Location::all();
     return view('locations', ['locations' => $location]);
 }
开发者ID:rhyme9316,项目名称:Programming-Assignments,代码行数:6,代码来源:LocationController.php

示例6: index

 public function index()
 {
     $locations = Location::with(’stories’)->get();
     return view(‘locations’, [‘locations’ => $locations]);
 }
开发者ID:alduin1992,项目名称:Programming-Assignments,代码行数:5,代码来源:LocationController.php


注:本文中的app\Location::with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。