Skip to content

Instantly share code, notes, and snippets.

@dgafka
Last active April 10, 2022 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgafka/99b22faaa4165ead92720ff1b8bdba22 to your computer and use it in GitHub Desktop.
Save dgafka/99b22faaa4165ead92720ff1b8bdba22 to your computer and use it in GitHub Desktop.
build-laravel-ddd-cqrs-application-01.php
<?php
class Article
{
public function publish()
{
if (!$this->isApproved) {
throw new \InvalidArgumentException("Can't publish unapproved article");
}
$this->isPublished = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment