/** * Update the specified resource in storage.rr * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $forum, $thread) { $thread = Thread::findBySlug($thread); $forum = Forum::findBySlug($forum); $this->authorize('update', $thread); $thread->update($request->all()); return redirect(route('intern.discuss.threads.show', [$thread->forum->slug, $thread->slug])); }
protected function findModel($id) { if (($model = Forum::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy(Forum $forum) { $forum->delete(); return Redirect::route('Forum.index')->with('message', 'Forum deleted.'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $forum = Forum::find($id); $this->authorize('delete', $forum); $forum->delete(); return redirect(route('intern.discuss.index')); }