Guest User

Untitled

a guest
May 24th, 2020
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. $factory->define(Model::class, function (Faker $faker) {
  2. return [
  3. 'name' => $faker->sentence(5),
  4. 'another_model' => factory(AnotherModel:class)->create()
  5. ];
  6. });
  7.  
  8. $factory->state(Model::class, 'testing', function ($faker) {
  9. return [
  10. 'another_model' => 1
  11. ];
  12. });
Advertisement
Add Comment
Please, Sign In to add comment