Hubungan beban yang bersemangat pada model yang ada di rute Laravel

Route::get('categories/{category:slug}', function(Category $category) {
    return view('posts', [
        'posts' => $category->posts->load(['category', 'author'])
    ]);
});
DJ Ultimate Disco Party