Laravel-Challenge-Movie-Table-Eloquent
Laravel-Challenge-Movie-Table-Eloquent copied to clipboard
Belce1982 solution - 3 Queries - 1000 Models - 23 MB
$movies = Movie::with('ratings','category')
->withAvg('ratings', 'rating')
->orderByDesc('ratings_avg_rating')
->take(100)
->get();
After putting foreign keys for ratings and category it goes down to 110 Models