|
@@ -17,7 +17,12 @@ class AuthorController extends Controller {
|
|
}
|
|
}
|
|
|
|
|
|
function view(Author $author) {
|
|
function view(Author $author) {
|
|
- return view("author", ["author" => $author->load(["books", "comments"])]);
|
|
|
|
|
|
+ return view("author", [
|
|
|
|
+ "author" => $author->load([
|
|
|
|
+ "books" => function($query) {},
|
|
|
|
+ "comments" => function($query) { $query->recent(); }
|
|
|
|
+ ])
|
|
|
|
+ ]);
|
|
}
|
|
}
|
|
|
|
|
|
function edit(Author $author) {
|
|
function edit(Author $author) {
|