diff --git a/app/Models/Shop/Category.php b/app/Models/Shop/Category.php index 217f253b..c0e1e7f0 100644 --- a/app/Models/Shop/Category.php +++ b/app/Models/Shop/Category.php @@ -25,6 +25,16 @@ class Category extends parentCategory protected $table = 'categories'; public $translatable = ['name', 'description']; protected $cascadeDeleteMorph = ['Articles']; + protected $fillable = [ + 'slug', + 'name', + 'visible', + 'description', + NestedSet::LFT, + NestedSet::RGT, + NestedSet::PARENT_ID, + ]; + public function Articles() { diff --git a/app/Repositories/Shop/Categories.php b/app/Repositories/Shop/Categories.php index e849f7fb..dcac0a4a 100644 --- a/app/Repositories/Shop/Categories.php +++ b/app/Repositories/Shop/Categories.php @@ -126,7 +126,7 @@ class Categories public static function update($data, $id = false) { - $id = $id ? $id : $data['id']; + $id = $id ? (int) $id : $data['id']; $category = self::get($id); $ret = $category->update($data); // CategoryTrees::update($data, $category->category_id);