converted comment section and the cannel info and the action buttons to components
This commit is contained in:
1 parent
84fcbd84dc
commit
64eadfaf56
10 files changed
+1324
-11985
No files matched your search
@@ -17,6 +17,7 @@ class CommentController extends Controller
|
||||
public function index(Video $video)
|
||||
{
|
||||
$comments = $video->comments()->whereNull('parent_id')->with(['user', 'replies.user'])->get();
|
||||
|
||||
return response()->json($comments);
|
||||
}
|
||||
|
||||
@@ -35,12 +36,14 @@ class CommentController extends Controller
|
||||
|
||||
// Handle mentions
|
||||
preg_match_all('/@(\w+)/', $request->body, $matches);
|
||||
if (!empty($matches[1])) {
|
||||
if (! empty($matches[1])) {
|
||||
// Mentions found - in production, you would send notifications here
|
||||
// For now, we just parse them
|
||||
}
|
||||
|
||||
return response()->json($comment->load('user'));
|
||||
$video->increment('comment_count');
|
||||
|
||||
return response()->json(['success' => true, 'comment' => $comment->load('user')]);
|
||||
}
|
||||
|
||||
public function update(Request $request, Comment $comment)
|
||||
@@ -67,6 +70,7 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
return response()->json(['success' => true]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user