本文整理匯總了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.');
}