Files
movies/app/Http/Controllers/Forum/ThreadsController.php
T

25 lines
674 B
PHP
Raw Normal View History

2025-01-27 22:40:26 +02:00
<?php
namespace App\Http\Controllers\Forum;
use App\Http\Controllers\Controller;
2025-02-10 01:58:12 +02:00
use App\Models\Forum\Category;
use App\Models\Forum\Thread;
use App\Models\Forum\Topic;
2025-01-27 22:40:26 +02:00
use Illuminate\Http\Request;
class ThreadsController extends Controller
{
2025-02-10 01:58:12 +02:00
public function show(string $categorySlug, string $threadSlug)
2025-02-02 14:23:11 +02:00
{
2025-02-10 01:58:12 +02:00
$category = Category::where('slug', $categorySlug)->first();
$thread = Thread::where('slug', $threadSlug)->first();
2025-02-02 14:23:11 +02:00
2025-02-10 01:58:12 +02:00
$topics = Topic::where('category_id', $category->id)
->where('thread_id', $thread->id)
->paginate(15);
return view('forum.thread', compact('category', 'thread', 'topics'));
2025-02-02 14:23:11 +02:00
}
2025-01-27 22:40:26 +02:00
}