Created
July 4, 2018 07:07
-
-
Save xiaoysh8/88e8d0ed590b7aa87335576261221aa2 to your computer and use it in GitHub Desktop.
laravel factory create
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
| factory(App\User::class, 100)->create()->each(function($u) { | |
| $u->profile()->save(factory(App\Models\Profile::class)->make()); | |
| $u->wx()->save(factory(App\Models\Wx::class)->make()); | |
| for( $i=0; $i<rand(0, 100); $i++){ | |
| $u->stats()->save(factory(App\Models\Stat::class)->make()); | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment