'alice@example.com', 'title' => 'Hello World', 'body' => 'My first post on TIDE.', ], [ 'email' => 'bob@example.com', 'title' => 'Riding the wave', 'body' => 'Bob shares his thoughts.', ], [ 'email' => 'carol@example.com', 'title' => 'Notes from week one', 'body' => 'Carol lays out her plan.', ], ]; foreach ($samples as $index => $sample) { $author = $this->userRepo->findByEmail( new EmailAddress($sample['email']), ); if ($author === null) { continue; } $this->postRepo->create(new CreatePostDto( userId: $author->getId(), title: $sample['title'], body: $sample['body'], createdAt: $now->modify("-{$index} hour"), )); } } }