Skip to content

Instantly share code, notes, and snippets.

@vineeth030
Last active November 4, 2017 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vineeth030/32242639a7bc5dd32db79260c5514901 to your computer and use it in GitHub Desktop.
Save vineeth030/32242639a7bc5dd32db79260c5514901 to your computer and use it in GitHub Desktop.
public function run()
{
factory(App\Teacher::class, 2)->create()->each(function ($teacher) {
$teacher->students()->saveMany(factory(App\Student::class, 25)->make());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment