public function addCommentToPost() { $in = Input::all(); if (GroupPage::isBelong($in['id'], Auth::user()->StudentID) && GroupPagePost::getGroupPagePostByID($in['pid'])->grouppageID == $in['id']) { GroupPagePostComment::create(['grouppagepostID' => $in['pid'], 'StudentID' => Auth::user()->StudentID, 'groupcomment' => $in['message']]); } return Redirect::to('/')->with('message', 'Comment successsfully posted.')->with('url', '/grouppage/' . $in['id'] . '/post/' . $in['pid'] . '/comment/'); }