Skip to content

[1.x] Extract switch team logic into HasTeams trait#312

Merged
taylorotwell merged 1 commit intolaravel:1.xfrom
chefe:extract-switch-team-logic
Oct 6, 2020
Merged

[1.x] Extract switch team logic into HasTeams trait#312
taylorotwell merged 1 commit intolaravel:1.xfrom
chefe:extract-switch-team-logic

Conversation

@chefe
Copy link
Contributor

@chefe chefe commented Oct 6, 2020

This PR extract the logic for team switching into the HasTeams trait, which allows to switch the current team from code.

Example: Use the switchTeam method to change the current team during a test.

/** @test */
public function xyz()
{
    $user = User::factory()->create();

    // ...

    $user->switchTeam($otherTeam);

    // ...
}

@chefe chefe force-pushed the extract-switch-team-logic branch from 2ca111a to 953512c Compare October 6, 2020 12:13
@taylorotwell taylorotwell merged commit 21a4469 into laravel:1.x Oct 6, 2020
@chefe chefe deleted the extract-switch-team-logic branch October 6, 2020 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants