/** * Delete a thread * * @param $threadId * @return mixed */ public function delete($threadId) { try { $thread = Thread::findOrFail($threadId); } catch (ModelNotFoundException $e) { Session::flash('error_message', 'The thread with ID: ' . $threadId . ' was not found.'); return Redirect::to('messages'); } $thread->delete(); return Redirect::to('messages/'); }