Esempio n. 1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     //显示文章详细
     $discussion = Discussion::findOrFail($id);
     return view('forum.show', compact('discussion'));
 }
Esempio n. 2
0
 public function update($id, Request $request)
 {
     $discussion = Discussion::findOrFail($id);
     $discussion->update($request->all());
     return redirect('d/' . $id);
 }
Esempio n. 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\StoreBolgRequest $request, $id)
 {
     $discussion = Discussion::findOrFail($id);
     $discussion->update($request->all());
     return redirect()->action('PostController@show', ['id' => $discussion->id]);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return \Illuminate\Http\Response
  */
 public function destroyConfirm(Request $request, $group_id, $discussion_id, $comment_id)
 {
     $comment = \App\Comment::findOrFail($comment_id);
     $group = \App\Group::findOrFail($group_id);
     $discussion = \App\Discussion::findOrFail($discussion_id);
     if (Gate::allows('delete', $comment)) {
         return view('comments.delete')->with('discussion', $discussion)->with('group', $group)->with('comment', $comment)->with('tab', 'discussion');
     } else {
         abort(403);
     }
 }