|
@@ -13,7 +13,7 @@ use App\Models\Author;
|
|
|
|
|
|
class BookController extends Controller {
|
|
class BookController extends Controller {
|
|
function index() {
|
|
function index() {
|
|
- $books = Book::all(); // Достать все книги
|
|
|
|
|
|
+ $books = Book::all()->load("author"); // Достать все книги
|
|
|
|
|
|
return view("books", ["rows" => $books]);
|
|
return view("books", ["rows" => $books]);
|
|
}
|
|
}
|