本文整理汇总了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'));
}
示例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);
}
}
示例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');
}
示例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'));
}
示例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!');
}
示例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'));
}
示例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'));
}
示例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
}
示例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'));
}