From 655f502279a2cfe4454f36ac5e1c7dcc7bd91845 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Fri, 18 Feb 2022 09:46:20 +0100 Subject: [PATCH] Fix visible --- app/Models/Shop/Category.php | 10 ++++++++++ app/Repositories/Shop/Categories.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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);