Merge remote-tracking branch 'origin/master' into Development
This commit is contained in:
@@ -112,6 +112,11 @@ public function segments(): BelongsToMany
|
||||
->wherePivot('active', true);
|
||||
}
|
||||
|
||||
public function attachedSegments(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(\App\Models\Segment::class);
|
||||
}
|
||||
|
||||
public function account(): HasOne
|
||||
{
|
||||
// Use latestOfMany to always surface newest account snapshot if multiple exist.
|
||||
@@ -130,6 +135,18 @@ public function documents(): MorphMany
|
||||
return $this->morphMany(\App\Models\Document::class, 'documentable');
|
||||
}
|
||||
|
||||
public function fieldJobs(): HasMany
|
||||
{
|
||||
return $this->hasMany(\App\Models\FieldJob::class);
|
||||
}
|
||||
|
||||
public function latestObject(): HasOne
|
||||
{
|
||||
return $this->hasOne(\App\Models\CaseObject::class)
|
||||
->whereNull('deleted_at')
|
||||
->latest();
|
||||
}
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::created(function (Contract $contract): void {
|
||||
|
||||
Reference in New Issue
Block a user