| @@ -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,8 +32,17 @@ | ||
| 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. | |
| 41 | + ]; | |
| 42 | + | |
| 43 | + protected $casts = [ | |
| 44 | + 'is_system' => 'boolean', | |
| 35 | 45 | ]; |
| 36 | 46 | |
| 37 | 47 | public function setSettingsAttribute($value) |
| 38 | 48 | { |