PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
← All changes | app/Models/AttributeGroup.php +12 -2 1.3.27 → 1.6.5 View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace FluentCart\App\Models;
4 4 use FluentCart\Framework\Support\Arr;
5 5 use FluentCart\App\Models\Concerns\CanSearch;
6 +use FluentCart\App\Models\Concerns\CanUpdateBatch;
6 7
7 8 /**
8 9 * Attributes Group Model - DB Model for Attributes Group eg: color, size etc
9 10 *
@@ -14,9 +15,9 @@
14 15 * @version 1.0.0
15 16 */
16 17 class AttributeGroup extends Model
17 18 {
18 - use CanSearch;
19 + use CanSearch, CanUpdateBatch;
19 20
20 21 public static function boot()
21 22 {
22 23 parent::boot();
@@ -31,10 +32,19 @@
31 32 'title',
32 33 'slug',
33 34 'description',
34 35 'settings',
36 + 'serial',
37 + // is_system intentionally NOT fillable — it's a trust flag that only the
38 + // seeder sets (via bulk insert, which bypasses fillable). Keeping it out
39 + // of mass-assignment means user-created groups stay is_system=0 even if
40 + // a client sneaks the field into a request body.
35 41 ];
36 42
43 + protected $casts = [
44 + 'is_system' => 'boolean',
45 + ];
46 +
37 47 public function setSettingsAttribute($value)
38 48 {
39 49 if (is_array($value)) {
40 50 $value = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
@@ -56,9 +66,9 @@
56 66
57 67 /**
58 68 * hasMany: Group has many Terms
59 69 *
60 - * @return \FluentCart\Framework\Database\Orm\Relations\hasMany
70 + * @return \FluentCart\Framework\Database\Orm\Relations\HasMany
61 71 */
62 72 public function terms()
63 73 {
64 74 return $this->hasMany(AttributeTerm::class, 'group_id', 'id');