@@ -71,8 +71,13 @@ class AuthorController extends Controller {
}
function drop(Author $author) {
- $author->books()->delete();
+ foreach($author->books as $book) {
+ $book->comments()->delete();
+ $book->delete();
+ }
+
$author->delete();
return view("success");
@@ -81,6 +81,7 @@ class BookController extends Controller {
function drop(Book $book) {
$book->delete();