29 lines
557 B
PHP
29 lines
557 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Models\Movie;
|
|
use App\Models\Comment;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$trendingMovies = Movie::orderBy('vote_average', 'desc')
|
|
->take(5)
|
|
->get();
|
|
|
|
$latestReviews = Comment::with('author')
|
|
->latest()
|
|
->take(5)
|
|
->get();
|
|
|
|
return view('home', compact('trendingMovies', 'latestReviews'));
|
|
}
|
|
}
|