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


PHP Property::findOrFail方法代码示例

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


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

示例1: billHouse

 public function billHouse($id)
 {
     $properties = Property::findOrFail($id);
     $houses = House::where('propertyID', '=', $id)->get();
     $records = House::where('status', '=', 'booked')->get();
     return View::make('backend.code.billing.housepro', compact('houses', 'properties', 'records'));
 }
开发者ID:jeremiteki,项目名称:mteja,代码行数:7,代码来源:HousController.php

示例2: show

 /**
  * Display the specified resource.
  * GET /properties/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if (Input::has('workorders')) {
         return Property::with('workorders.user')->with('workorders.property')->findOrFail($id);
     } else {
         return Property::findOrFail($id);
     }
 }
开发者ID:sahilkathpal,项目名称:hackcoin,代码行数:15,代码来源:PropertiesController.php

示例3: postUpdate

 /**
  * Update the specified property in storage.
  *
  * @param  int $id
  * @return Response
  */
 public function postUpdate($id)
 {
     $property = Property::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Property::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $property->update($data);
     return Redirect::action('PropertiesController@getIndex');
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:16,代码来源:PropertiesController.php

示例4: show

 /**
  * Display the specified resource.
  * GET /properties/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $properties = Property::findOrFail($id);
     return View::make('backend.code.property.show', compact('properties'));
 }
开发者ID:jeremiteki,项目名称:mteja-laravel,代码行数:12,代码来源:PropertiesController.php

示例5: destroy

 /**
  * Remove the specified kin from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $property = Property::findOrFail($id);
     Property::destroy($id);
     Audit::logaudit('Properties', 'delete', 'deleted: ' . $property->name);
     return Redirect::route('Properties.index')->withDeleteMessage('Company Property successfully deleted!');
 }
开发者ID:kenkode,项目名称:xpose,代码行数:13,代码来源:PropertiesController.php

示例6: edit

 /**
  * Show the form for editing the specified resource.
  * GET /branch/{id}/edit
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $property = Property::findOrFail($id);
     return View::make('backend.landings.edit', compact('property'));
 }
开发者ID:pombredanne,项目名称:licenser-7,代码行数:12,代码来源:LicenseController.php

示例7: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $reservation = $this->reservation->findOrFail($id);
     $property = Property::findOrFail($reservation->property_id);
     return View::make('admin.reservations.show', compact('reservation', 'property'));
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:12,代码来源:ReservationsController.php

示例8: postUpdateRates

 public function postUpdateRates()
 {
     $rules = ['from_date' => 'required|date_format:Y-m-d|after:' . date('Y-m-d', strtotime('yesterday')), 'to_date' => 'required|date_format:Y-m-d|after:' . date('Y-m-d', strtotime('yesterday')), 'week_day' => 'required', 'rooms' => 'required', 'rate' => 'required|numeric|min:0', 'single_rate' => 'numeric|min:0'];
     $validator = Validator::make($data = Input::all(), $rules);
     if ($validator->fails()) {
         return Response::json(['success' => false, 'errors' => $validator->getMessageBag()->toArray()], 400);
         //400 - http error code
     }
     //all ok so get rooms and plans mapping
     $weekDays = $data['week_day'];
     $errors = [];
     $property = Property::findOrFail(Property::getLoggedId());
     foreach ($data['rooms'] as $roomId) {
         //get room data
         $room = Room::findOrFail($roomId);
         $depth = 0;
         $this->updateChannelRate($room, $property, $data, $data['rate'], $weekDays, $errors, $depth);
     }
     if (!empty($errors)) {
         return Response::json(['success' => false, 'errors' => $errors], 400);
         //400 - http error code
     }
     return Response::json(['success' => true], 200);
     //200 - http success code
 }
开发者ID:jonagoldman,项目名称:channelmanager,代码行数:25,代码来源:BulkController.php

示例9: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $property = $this->property->findOrFail($id);
     return View::make('admin.properties.show', compact('property'));
 }
开发者ID:jacobDaeHyung,项目名称:Laravel-Real-Estate-Manager,代码行数:11,代码来源:PropertiesController.php


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