Skip to content

Commit

Permalink
Add published state method
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni committed Aug 30, 2024
1 parent 1492728 commit 58cafe6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Factories/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,15 @@ public function site(string $site): self
};
}

public function published(bool|string $published): self
{
return match ($published) {
'random' => $this->sequence(fn (Sequence $sequence) => ['published' => collect([true, false])->random()]),
false, 'false' => $this->set('published', false),
default => $this->set('published', true),
};
}

protected function getSitesFromContentModel(): Collection
{
$contentModel = $this->newContentModel();
Expand Down

0 comments on commit 58cafe6

Please sign in to comment.