コード例 #1
0
ファイル: ChildEntityTest.php プロジェクト: spira/api-core
 /**
  * @param TestEntity $model
  */
 protected function addRelatedEntities(TestEntity $model)
 {
     $this->getFactory(SecondTestEntity::class)->count(5)->make()->each(function (SecondTestEntity $entity) use($model) {
         $model->testMany()->save($entity);
     });
 }