public function menuInfo() { //throw new \Exception("Esta é uma exceção de teste"); $tagController = new TagController(); $commentController = new CommentController(); return array($tagController->all(), $commentController->last()); }
public function getMenuInfo() { $tagController = new TagController(); $commentController = new CommentController(); $authUser = Auth::user(); return array($tagController->getAll(), $commentController->last(), $authUser); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function getShow($id) { $post = PostDados::join('users', 'posts.userid', '=', 'users.id')->select('posts.*', 'users.name')->where('posts.id', $id)->get(); $post = $post[0]; $comments = CommentController::show($id); $userId = Auth::id(); return view('view', compact('post'), compact('comments', 'userId')); }
public function show(Post $post, User $user, Request $request, Comment $comment) { $post = Post::with('user.votes')->with('subreddit.moderators')->findOrFail($post->id); $ids = $post->subreddit; $check = $ids->moderators()->where('user_id', Auth::id())->first(); $isModerator = $check ? true : false; $modList = Moderator::where('subreddit_id', '=', $post->subreddit->id)->get(); $view_data = CommentController::view_data($request, $post, $comment, $isModerator); return view('post/show', $view_data)->with('post', $post)->with('modList', $modList)->with('isModerator', $isModerator); }
public function index(Request $request, Post $post, Comment $comment) { $view_data = CommentController::view_data($request, $post->id); return view('eastgate.comment.leave_a_comment', $view_data); }