Ver Fonte

Also delete the books when deleting an author

axkuhta há 1 ano atrás
pai
commit
be951034d4
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      app/Http/Controllers/AuthorController.php

+ 1 - 0
app/Http/Controllers/AuthorController.php

@@ -71,6 +71,7 @@ class AuthorController extends Controller {
 	}
 
 	function drop(Author $author) {
+		$author->books()->delete();
 		$author->delete();
 		return view("success");
 	}