all is working great

This commit is contained in:
ghassan committed 2026-03-15 04:55:18 +03:00
1 parent f850f40f78
commit 3b09f4baed
2 files changed
+202 -137

No files matched your search

+14 -1
View File
@@ -201,7 +201,7 @@ class VideoController extends Controller
}
// Load comments with user relationship
$video->load(['comments.user', 'comments.replies.user']);
$video->load(['comments.user', 'comments.replies.user', 'matchRounds.points', 'coachReviews']);
// Handle playlist navigation if playlist parameter is provided
$playlist = null;
@@ -236,6 +236,19 @@ class VideoController extends Controller
return view($view, compact('video', 'playlist', 'nextVideo', 'previousVideo', 'recommendedVideos', 'playlistVideos'));
}
public function matchData(Video $video)
{
if (! $video->canView(Auth::user())) {
abort(403);
}
return response()->json([
'success' => true,
'rounds' => $video->matchRounds()->with('points')->orderBy('round_number')->get(),
'reviews' => $video->coachReviews()->orderBy('start_time_seconds')->get(),
]);
}
public function edit(Video $video, Request $request)
{
// Check if user owns the video