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


PHP Address::all方法代码示例

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


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

示例1: index

 /**
  * Returns home page of all the wells, the index.
  * 
  * @return index.blade.php View
  */
 public function index()
 {
     /* 
     Sets the Well Variable to null, or to the current users well. Used
     for populating the well modal (not model, I'm talking about the 
     bootstrap component) with information 
     */
     if (Auth::check()) {
         if (Address::where('user_id', Auth::user()->id)->first()) {
             $well = Address::where('user_id', Auth::user()->id)->first();
         } else {
             $well = null;
         }
     }
     //Gets all the Addresses from the database, then puts them into JSON so Javascript can read it.
     $addresses = Address::all();
     $addresses = json_encode($addresses);
     return View::make('index', compact('addresses', 'well'));
 }
开发者ID:gdroel,项目名称:well-basically,代码行数:24,代码来源:HomeController.php

示例2: index

 public function index()
 {
     $aryDrug = Drug::all();
     $objJson = array();
     foreach ($aryDrug as $drug) {
         switch ($drug->type) {
             case 1:
                 $objJson[] = array("type" => $drug->type, "defaults" => array("morning" => $drug->morning, "lunch" => $drug->lunch, "afternoon" => $drug->afternoon, "night" => $drug->night), 'total' => -1);
                 break;
             case 2:
             case 3:
                 $objJson[] = array("type" => $drug->type, "fixed" => $drug->fixed, "special" => $drug->special);
                 break;
             case 4:
                 $objJson[] = array("type" => $drug->type, "fixed" => $drug->fixed);
                 break;
         }
     }
     return View::make('medical.medical', array('address' => Address::all(), 'diseases' => Disease::all(), 'drugs' => Drug::all(), 'current_day' => Config::get('constants.current_day', 3), 'max_day' => Config::get('constants.max_day', 7), 'drug' => json_encode($objJson)));
 }
开发者ID:EyeStorm,项目名称:kedon,代码行数:20,代码来源:MedicalController.php

示例3: pod

 public function pod()
 {
     $addresses = \Address::all();
     return View::make('support/pod', compact('addresses'));
 }
开发者ID:Khelek,项目名称:ipsol,代码行数:5,代码来源:SupportController.php

示例4: index

 public function index()
 {
     return Response::json(array('address' => Address::all(), 'diseases' => Disease::all(), 'drugs' => Drug::all(), 'current_day' => Config::get('constants.current_day', 3), 'max_day' => Config::get('constants.max_day', 7)));
 }
开发者ID:EyeStorm,项目名称:tn-huan-it,代码行数:4,代码来源:MedicalController.php

示例5: index

 /**
  * Display a listing of addresses
  *
  * @return Response
  */
 public function index()
 {
     $addresses = Address::all();
     return View::make('addresses.index', compact('addresses'));
 }
开发者ID:sharad23,项目名称:angular,代码行数:10,代码来源:AddressesController.php

示例6: json_encode

    $newAddress->complement = $complement;
    $newAddress->neighborhood = $neighborhood;
    $newAddress->city = $city;
    $newAddress->state = $state;
    if ($newAddress->save()) {
        $data['msg'] = 'Address saved successfully!';
        $data['id'] = $newAddress->id;
    } else {
        $data['msg'] = 'An error occurred while saving the address!';
    }
    $contactList->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
// Get all address to one contact
$contactList->get("/addresses", function () use($contactList) {
    $addresses = Address::all();
    $contactList->response()->header('Content-Type', 'application/json');
    echo json_encode(objectToArray(json_decode($addresses)));
});
// Get specific address
$contactList->get("/addresses/:id", function ($id) use($contactList) {
    $addresses = Address::find($id);
    $contactList->response()->header('Content-Type', 'application/json');
    echo json_encode(objectToArray(json_decode($addresses)));
});
// Add new address
$contactList->post("/addresses", function () use($contactList) {
    $contactId = $contactList->request->params('contactid');
    $zipcode = $contactList->request->params('zipcode');
    $address = $contactList->request->params('address');
    $complement = $contactList->request->params('complement');
开发者ID:vitorm11,项目名称:contactlist,代码行数:31,代码来源:index.php


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