factory(AppUser::class, 30)->create()->each(function($user) { $entity = factory(AppEntity::class)->make(); $address = factory(AppAddress::class)->create([ 'entity_id' => $entity ]); $user->entities()->save($entity); });