26 lines
501 B
PHP
26 lines
501 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Topic;
|
|
|
|
class TopicsController extends Controller
|
|
{
|
|
/**
|
|
* Load a single Topic view
|
|
*
|
|
* @param mixed $topic
|
|
* @return void
|
|
*/
|
|
public function show(Topic $topic)
|
|
{
|
|
return view('topics.show', [
|
|
'topic' => $topic,
|
|
'articles' => $topic->articles()->with('source')
|
|
->latest('published_date')
|
|
->paginate(12)
|
|
]);
|
|
}
|
|
}
|