diff --git a/app/Livewire/Wrestlers/PreviousTagTeamsTable.php b/app/Livewire/Wrestlers/PreviousTagTeamsTable.php index 0dc48b4d..6c8219a6 100644 --- a/app/Livewire/Wrestlers/PreviousTagTeamsTable.php +++ b/app/Livewire/Wrestlers/PreviousTagTeamsTable.php @@ -15,7 +15,7 @@ class PreviousTagTeamsTable extends DataTableComponent { use ShowTableTrait; - protected string $databaseTableName = 'tag_team_wrestler'; + protected string $databaseTableName = 'tag_teams_wrestlers'; protected string $resourceName = 'tag teams'; @@ -39,7 +39,7 @@ public function builder(): Builder public function configure(): void { $this->addAdditionalSelects([ - 'tag_team_wrestler.tag_team_id as tag_team_id', + 'tag_teams_wrestlers.tag_team_id as tag_team_id', ]); } diff --git a/app/Models/Concerns/CanJoinTagTeams.php b/app/Models/Concerns/CanJoinTagTeams.php index 201235f9..80b64eea 100644 --- a/app/Models/Concerns/CanJoinTagTeams.php +++ b/app/Models/Concerns/CanJoinTagTeams.php @@ -24,7 +24,7 @@ trait CanJoinTagTeams */ public function tagTeams(): BelongsToMany { - return $this->belongsToMany(TagTeam::class, 'tag_team_wrestler') + return $this->belongsToMany(TagTeam::class, 'tag_teams_wrestlers') ->withPivot(['joined_at', 'left_at']) ->using(TagTeamPartner::class); } @@ -56,7 +56,7 @@ public function previousTagTeam(): BelongsToOne */ public function currentTagTeam(): BelongsToOne { - return $this->belongsToOne(TagTeam::class) + return $this->belongsToOne(TagTeam::class, 'tag_teams_wrestlers') ->wherePivotNull('left_at') ->withPivot(['joined_at', 'left_at']); } diff --git a/app/Models/Concerns/HasWrestlers.php b/app/Models/Concerns/HasWrestlers.php index 2f0ffde4..e29cabe0 100644 --- a/app/Models/Concerns/HasWrestlers.php +++ b/app/Models/Concerns/HasWrestlers.php @@ -18,7 +18,7 @@ trait HasWrestlers */ public function wrestlers(): BelongsToMany { - return $this->belongsToMany(Wrestler::class, 'tag_team_wrestler') + return $this->belongsToMany(Wrestler::class, 'tag_teams_wrestlers') ->withPivot('joined_at', 'left_at') ->using(TagTeamPartner::class); }