diff --git a/app/Http/Controllers/TopicsController.php b/app/Http/Controllers/TopicsController.php index f33e585..1d488a4 100644 --- a/app/Http/Controllers/TopicsController.php +++ b/app/Http/Controllers/TopicsController.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; use App\Topic; class TopicsController extends Controller -{ +{ /** * Load a single Topic view * @@ -16,7 +16,10 @@ class TopicsController extends Controller public function show(Topic $topic) { return view('topics.show', [ - 'topic' => $topic->load('articles') + 'topic' => $topic, + 'articles' => $topic->articles()->with('source') + ->latest('published_date') + ->paginate(12) ]); } } diff --git a/resources/views/topics/show.blade.php b/resources/views/topics/show.blade.php index 993f516..f49de59 100644 --- a/resources/views/topics/show.blade.php +++ b/resources/views/topics/show.blade.php @@ -17,7 +17,7 @@