*/ use HasFactory; use SyncsProjectTemplateOwnership; protected static function booted(): void { static::saving(function (self $ticketLinkType): void { $ticketLinkType->syncProjectTemplateOwnership(); }); } public function counterpartLabel(): string { return $this->counterpart_label ?: $this->label; } public function labelForSource(bool $isSourceTicket): string { return $isSourceTicket ? $this->label : $this->counterpartLabel(); } public function project(): BelongsTo { return $this->belongsTo(Project::class); } public function ticketLinks(): HasMany { return $this->hasMany(TicketLink::class) ->orderBy('id'); } }