Created
October 28, 2017 16:56
-
-
Save deleugpn/9ec5b8ee5de25bf2f4da96a350b83570 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use App\Models\Main\User; | |
| use App\Models\Main\Company; | |
| use Faker\Generator as Faker; | |
| $factory->define(User::class, function (Faker $faker) { | |
| static $password; | |
| return [ | |
| 'name' => $faker->name, | |
| 'email' => $faker->unique()->safeEmail, | |
| 'password' => $password ?: $password = bcrypt('secret'), | |
| 'remember_token' => str_random(10), | |
| 'company_id' => factory(Company::class) | |
| ]; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment