added life cycle callbacks to Blog.php