'datetime', 'ends_at' => 'datetime', 'active' => 'boolean']; } public function groups(): BelongsToMany { return $this->belongsToMany(DirectoryGroup::class, 'campaign_group'); } public function scopeRunning(Builder $q): Builder { return $q->where('active', true)->where('starts_at', '<=', now())->where('ends_at', '>=', now()); } }