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