© 2026 Hedgehog Software, LLC
class Company extends Model { public function events(): BelongsToMany { return $this->belongsToMany(Event::class) ->using(CompanyEvent::class) ->as('events') ->withPivot([ 'profile_id' ]); } public function profiles(): HasMany { return $this->hasMany(CompanyProfile::class); } } class Event extends Model { public function companies(): BelongsToMany { return $this->belongsToMany(Company::class) ->as('companies') ->using(CompanyEvent::class) ->withPivot([ 'profile_id', ]); } } class CompanyEvent extends Pivot { protected $fillable = [ 'company_id', 'event_id', 'profile_id', ]; public function profile(): BelongsTo { return $this->belongsTo(CompanyProfile::class); } }
company_event
EventResource->CompaniesRelationManager
Tables\Columns\TextColumn::make('companies.profile.name')