Changed to topic link
This commit is contained in:
@@ -29,7 +29,7 @@ class TopicsController extends Controller
|
||||
public function show(Topic $topic) : JsonResponse
|
||||
{
|
||||
return response()->json([
|
||||
'topic' => $topic,
|
||||
'topic' => new TopicResource($topic),
|
||||
'articles' => $topic->articles()->paginate(8)
|
||||
]);
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ class TopicResource extends JsonResource
|
||||
return [
|
||||
"name" => $this->name,
|
||||
"slug" => $this->slug,
|
||||
"url" => url(route('topics.show', $this->slug))
|
||||
"link" => url(route('topics.show', $this->slug))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user