some progress

This commit is contained in:
2025-01-29 22:33:09 +02:00
parent 8de53f3ec2
commit 86eef55170
11 changed files with 157 additions and 10 deletions
+13 -1
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Models\Comment;
use App\Models\Movie;
use Illuminate\Http\Request;
@@ -20,6 +21,17 @@ class MovieController extends Controller
->where('slug', $slug)
->firstOrFail();
return view('movie.show', compact('movie'));
// comments
$comments = Comment::where(function($query) use ($movie){
$query->where(function($query) use ($movie){
$query->where('entity_id', $movie->id)
->where('entity_type', Comment::TYPE_MOVIE);
})
->orWhere('tmdb_id', $movie->tmdb_id);
})
->paginate(15);
return view('movie.show', compact('movie', 'comments'));
}
}