feat: playlist out of its object in by id
This commit is contained in:
@@ -98,8 +98,9 @@ public function show($id)
|
|||||||
->latest()
|
->latest()
|
||||||
->paginate(15);
|
->paginate(15);
|
||||||
|
|
||||||
return response()->json([
|
return response()->json(array_merge(
|
||||||
$playlist,
|
$playlist->toArray(),
|
||||||
|
[
|
||||||
'statistics' => [
|
'statistics' => [
|
||||||
'total_musics' => $playlist->musics->count(),
|
'total_musics' => $playlist->musics->count(),
|
||||||
'total_duration' => $playlist->total_duration,
|
'total_duration' => $playlist->total_duration,
|
||||||
@@ -115,7 +116,8 @@ public function show($id)
|
|||||||
'has_saved' => $playlist->is_saved,
|
'has_saved' => $playlist->is_saved,
|
||||||
],
|
],
|
||||||
'comments' => $comments,
|
'comments' => $comments,
|
||||||
]);
|
]
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
|
|||||||
Reference in New Issue
Block a user