Skip to content

Instantly share code, notes, and snippets.

@henriqueweiand
Created August 7, 2019 16:02
Show Gist options
  • Save henriqueweiand/bb7e208194de7a4236bcdac3807fa9e7 to your computer and use it in GitHub Desktop.
Save henriqueweiand/bb7e208194de7a4236bcdac3807fa9e7 to your computer and use it in GitHub Desktop.
<?php
$factory->define(App\Users::class, function (Faker\Generator $faker) {
return [
'name' => $faker->name,
'lastname' => $faker->lastName,
'email' => $faker->email,
'telephone' => $faker->phoneNumber,
];
});
/**
* Factory definition for model App\Task.
*/
$factory->define(App\Messages::class, function ($faker) {
$user = factory('App\Users')->create();
return [
'user_id' => $user['id'],
'description' => $faker->text,
];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment