16 lines
363 B
PHP
16 lines
363 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use App\Models\Category;
|
||
|
use App\Models\Topic;
|
||
|
|
||
|
class CategoriesController extends Controller
|
||
|
{
|
||
|
public function show(Category $category)
|
||
|
{
|
||
|
$topics = Topic::where('category_id', $category->id)->with('user', 'category')->paginate();
|
||
|
return view('topics.index', compact('topics', 'category'));
|
||
|
}
|
||
|
}
|