diff --git a/app/models/Category.php b/app/models/Category.php index 2e46bdd57b..9251acddb1 100644 --- a/app/models/Category.php +++ b/app/models/Category.php @@ -3,28 +3,29 @@ class Category extends Eloquent { /** - * Deletes a blog post and all the associated comments. + * Deletes a category * * @return bool */ + + protected $table = 'categories'; + public function delete() { - - - // Delete the blog post - //return parent::delete(); + // Delete the category + return parent::delete(); } + /** - * Returns a formatted post content entry, this ensures that - * line breaks are returned. - * - * @return string - */ - public function name() + * Get the parent category name + */ + public function parentname() { - return nl2br($this->name); + return $this->belongsTo('Category','parent'); } + + }