Skip to content

Commit

Permalink
add User::factory()->withTwitter() scope
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher committed Feb 14, 2022
1 parent f924369 commit 06f9b07
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,21 @@ public function withPersonalTeam()
'ownedTeams'
);
}

/**
* Indicate that the should have their twitter fields filled.
*
* @return \Illuminate\Database\Eloquent\Factories\Factory
*/
public function withTwitter()
{
return $this->state(function (array $attributes) {
return [
'twitter_id' => null,
'twitter_nickname' => $this->faker->unique()->username(),
'twitter_avatar' => null,
'twitter_token' => Str::random(32),
];
});
}
}

0 comments on commit 06f9b07

Please sign in to comment.