public function destroy($id) { $Ticket = Ticket::findOrFail($id); $Ticket->delete(); Session::flash('flash_message', 'Ticket successfully deleted!'); return redirect()->route('tickets.index'); }
/** * 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')); }
/** * Remove the specified resource from storage. * * @param int $id * * @return Response */ public function destroy($id) { Ticket::destroy(Ticket::findOrFail($id)); Ticket::destroy($id); }
/** * 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')); }
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.'); }