Skip to content

Commit

Permalink
Update relationship name for tag team wrestlers
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyDavidson committed Nov 19, 2024
1 parent dc5f0f2 commit 3afae8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/Livewire/Wrestlers/PreviousTagTeamsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Models/Concerns/CanJoinTagTeams.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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']);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Concerns/HasWrestlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3afae8c

Please sign in to comment.