本文整理汇总了PHP中Report::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::findOrFail方法的具体用法?PHP Report::findOrFail怎么用?PHP Report::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::findOrFail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dismiss
public function dismiss()
{
// check we're logged in
if (!Auth::check()) {
Session::flash('redirect', URL::route('reports'));
return Redirect::route('login');
}
$reportId = Input::get('report');
$report = Report::findOrFail($reportId);
$report->delete();
return Redirect::route('reports')->with('success', 'Report dismissed');
}
示例2: postUpdate
public function postUpdate()
{
$reports = Input::get('reports');
if (is_null($reports)) {
Redirect::back();
}
foreach ($reports as $r) {
$report = Report::findOrFail($r['report']);
$report->fill($r);
$report->save();
}
return App::make('TournamentsController')->ranking(Tournament::findOrFail(Input::get('tournament')));
}
示例3: edit
/**
* Show the form for editing the specified reportgrouping.
*
* @param int $id
* @return Response
*/
public function edit($report_id, $id)
{
$reportgrouping = ReportGrouping::findOrFail($id);
if (Request::ajax()) {
return $this->_ajax_denied();
}
if (!$reportgrouping->canUpdate()) {
return _access_denied();
}
$report = Report::findOrFail($report_id);
return View::make('reportgroupings.edit', compact('reportgrouping', 'report_id', 'report'));
}
示例4: show
/**
* Display the specified resource.
* GET /reports/{id}
*
* @param int $id
* @return Response
*/
public function show($id)
{
return Report::findOrFail($id);
}
示例5: destroy
/**
* Remove the specified report from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$report = Report::findOrFail($id);
if (!$report->canDelete()) {
return $this->_access_denied();
}
$report->delete();
if (Request::ajax()) {
return Response::json($this->deleted_message);
}
return Redirect::action('ReportsController@index')->with('notification:success', $this->deleted_message);
}
示例6: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$report = $this->report->findOrFail($id);
return View::make('reports.show', compact('report'));
}