Skip to content

Instantly share code, notes, and snippets.

@vineeth030
Created November 4, 2017 06:39
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/8ae2557e428f7c1debe9bd19720c0f4d to your computer and use it in GitHub Desktop.
Save vineeth030/8ae2557e428f7c1debe9bd19720c0f4d to your computer and use it in GitHub Desktop.
Model factories for relationship seeding
$factory->define(App\Student::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'marks' => $faker->numberBetween(0,100),
];
});
$factory->define(App\Teacher::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'phone' => $faker->phoneNumber,
];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment