diff --git a/src/Traits/HasActive.php b/src/Traits/HasActive.php index 422fa52..c3fb91a 100644 --- a/src/Traits/HasActive.php +++ b/src/Traits/HasActive.php @@ -6,6 +6,15 @@ trait HasActive { + public function bootHasActive(): void + { + // append the is_active column to the fillable array + $this->fillable[] = 'is_active'; + + // add the is_active column to the casts array + $this->casts['is_active'] = 'boolean'; + } + public function scopeStatus(mixed $query, bool $status): Builder { return $query->where('is_active', $status);