API changes
This commit is contained in:
@@ -26,13 +26,12 @@ class TopicsAPIController extends Controller
|
||||
* Load all the articles for a given topics
|
||||
*
|
||||
* @param mixed $topic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function show(Topic $topic) : JsonResponse
|
||||
public function show(Topic $topic)
|
||||
{
|
||||
return response()->json([
|
||||
return [
|
||||
'topic' => new TopicResource($topic),
|
||||
'articles' => ArticleResource::collection($topic->articles()->paginate(8))
|
||||
]);
|
||||
'articles' => $topic->articles()->paginate(8)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user