*/ use HasFactory; protected $fillable = ['name', 'color_tag', 'auto_mail', 'email_template_id']; protected function casts(): array { return [ 'auto_mail' => 'boolean', ]; } public function actions(): BelongsToMany { return $this->belongsToMany(\App\Models\Action::class); } public function events(): BelongsToMany { return $this->belongsToMany(\App\Models\Event::class) ->withPivot(['run_order', 'active', 'config']) ->withTimestamps(); } public function activities(): HasMany { return $this->hasMany(\App\Models\Activity::class); } public function emailTemplate(): BelongsTo { return $this->belongsTo(\App\Models\EmailTemplate::class, 'email_template_id'); } }