Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $factory->define(Model::class, function (Faker $faker) {
- return [
- 'name' => $faker->sentence(5),
- 'another_model' => factory(AnotherModel:class)->create()
- ];
- });
- $factory->state(Model::class, 'testing', function ($faker) {
- return [
- 'another_model' => 1
- ];
- });
Advertisement
Add Comment
Please, Sign In to add comment