We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e217f9a commit e644e27Copy full SHA for e644e27
src/Traits/HasActive.php
@@ -6,6 +6,15 @@
6
7
trait HasActive
8
{
9
+ public function bootHasActive(): void
10
+ {
11
+ // append the is_active column to the fillable array
12
+ $this->fillable[] = 'is_active';
13
+
14
+ // add the is_active column to the casts array
15
+ $this->casts['is_active'] = 'boolean';
16
+ }
17
18
public function scopeStatus(mixed $query, bool $status): Builder
19
20
return $query->where('is_active', $status);
0 commit comments