本文整理汇总了PHP中Ticket::findOrFail方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::findOrFail方法的具体用法?PHP Ticket::findOrFail怎么用?PHP Ticket::findOrFail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::findOrFail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$Ticket = Ticket::findOrFail($id);
$Ticket->delete();
Session::flash('flash_message', 'Ticket successfully deleted!');
return redirect()->route('tickets.index');
}
示例2: getEdit
/**
* Show the form for editing the specified resource.
*
* @param $post
* @return Response
*/
public function getEdit($id)
{
// Title
$title = Lang::get('admin/tickets/title.ticket_update');
$priorities = array('urgent', 'high', 'medium', 'low');
$ticket = $id !== false ? Ticket::findOrFail($id) : null;
// Show the page
return View::make('admin/tickets/create_edit', compact('ticket', 'priorities', 'title'));
}
示例3: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return Response
*/
public function destroy($id)
{
Ticket::destroy(Ticket::findOrFail($id));
Ticket::destroy($id);
}
示例4: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$ticket = $this->ticket->findOrFail($id);
return View::make('tickets.show', compact('ticket'));
}
示例5: get_helpdeskdelete
public function get_helpdeskdelete($id)
{
//Verify the ticket exists
$ticket = Ticket::findOrFail($id);
//Now delete the replies to start
Ticket::find($id)->replies()->delete();
//And finally the ticket
$ticket->delete();
//That was easy. Now just redirect back to the dashboard with a message
return Redirect::route('console')->with('message', 'Ticket successfully deleted.');
}