├── .env.example ├── .gitattributes ├── .gitignore ├── app ├── CQRS │ ├── DomainEventMessage.php │ ├── EloquentEventStore │ │ ├── CreateEloquentEventStore.php │ │ ├── DropEloquentEventStore.php │ │ ├── EloquentEventStoreModel.php │ │ └── EloquentEventStoreRepository.php │ ├── EventSourcedEntity.php │ ├── EventSourcedEntityInterface.php │ ├── EventSourcedEntityRepository.php │ ├── ReadModel │ │ ├── ImmutableModel.php │ │ └── SavingImmutableModel.php │ └── Serializer │ │ ├── EventSerializer.php │ │ └── SerializableEvent.php ├── Commands │ └── Command.php ├── Console │ ├── Commands │ │ └── Inspire.php │ └── Kernel.php ├── Events │ └── Event.php ├── Exceptions │ └── Handler.php ├── Handlers │ ├── Commands │ │ └── .gitkeep │ └── Events │ │ └── .gitkeep ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── AuthController.php │ │ │ └── PasswordController.php │ │ ├── Controller.php │ │ ├── HomeController.php │ │ └── WelcomeController.php │ ├── Kernel.php │ ├── Middleware │ │ ├── Authenticate.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php │ ├── Requests │ │ └── Request.php │ └── routes.php ├── Providers │ ├── AppServiceProvider.php │ ├── BusServiceProvider.php │ ├── ConfigServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── School │ ├── Client │ │ └── Projections │ │ │ ├── ClientProjection.php │ │ │ └── ClientProjector.php │ ├── Lesson │ │ ├── Commands │ │ │ ├── BookClientOntoLesson.php │ │ │ └── BookLesson.php │ │ ├── Events │ │ │ ├── ClientBookedOntoLesson.php │ │ │ └── LessonWasOpened.php │ │ ├── Exceptions │ │ │ └── TooManyClientsAddedToLesson.php │ │ ├── Lesson.php │ │ ├── LessonId.php │ │ ├── LessonRepository.php │ │ └── Projections │ │ │ ├── LessonProjection.php │ │ │ └── LessonProjector.php │ └── ReadModels │ │ ├── Client.php │ │ └── Lesson.php ├── Services │ └── Registrar.php └── User.php ├── artisan ├── bootstrap ├── app.php └── autoload.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── compile.php ├── database.php ├── filesystems.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── migrations │ ├── .gitkeep │ ├── 2015_05_08_115901_CreateLessonTable.php │ └── 2015_05_09_192741_create_clients_table.php └── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── gulpfile.js ├── package.json ├── phpspec.yml ├── phpunit.xml ├── public ├── .htaccess ├── css │ └── app.css ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── index.php └── robots.txt ├── readme.md ├── resources ├── assets │ └── less │ │ ├── app.less │ │ └── bootstrap │ │ ├── alerts.less │ │ ├── badges.less │ │ ├── bootstrap.less │ │ ├── breadcrumbs.less │ │ ├── button-groups.less │ │ ├── buttons.less │ │ ├── carousel.less │ │ ├── close.less │ │ ├── code.less │ │ ├── component-animations.less │ │ ├── dropdowns.less │ │ ├── forms.less │ │ ├── glyphicons.less │ │ ├── grid.less │ │ ├── input-groups.less │ │ ├── jumbotron.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── media.less │ │ ├── mixins.less │ │ ├── mixins │ │ ├── alerts.less │ │ ├── background-variant.less │ │ ├── border-radius.less │ │ ├── buttons.less │ │ ├── center-block.less │ │ ├── clearfix.less │ │ ├── forms.less │ │ ├── gradients.less │ │ ├── grid-framework.less │ │ ├── grid.less │ │ ├── hide-text.less │ │ ├── image.less │ │ ├── labels.less │ │ ├── list-group.less │ │ ├── nav-divider.less │ │ ├── nav-vertical-align.less │ │ ├── opacity.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── progress-bar.less │ │ ├── reset-filter.less │ │ ├── resize.less │ │ ├── responsive-visibility.less │ │ ├── size.less │ │ ├── tab-focus.less │ │ ├── table-row.less │ │ ├── text-emphasis.less │ │ ├── text-overflow.less │ │ └── vendor-prefixes.less │ │ ├── modals.less │ │ ├── navbar.less │ │ ├── navs.less │ │ ├── normalize.less │ │ ├── pager.less │ │ ├── pagination.less │ │ ├── panels.less │ │ ├── popovers.less │ │ ├── print.less │ │ ├── progress-bars.less │ │ ├── responsive-embed.less │ │ ├── responsive-utilities.less │ │ ├── scaffolding.less │ │ ├── tables.less │ │ ├── theme.less │ │ ├── thumbnails.less │ │ ├── tooltip.less │ │ ├── type.less │ │ ├── utilities.less │ │ ├── variables.less │ │ └── wells.less ├── lang │ └── en │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── app.blade.php │ ├── auth │ ├── login.blade.php │ ├── password.blade.php │ ├── register.blade.php │ └── reset.blade.php │ ├── emails │ └── password.blade.php │ ├── errors │ └── 503.blade.php │ ├── home.blade.php │ ├── vendor │ └── .gitkeep │ └── welcome.blade.php ├── server.php ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── CQRSTest.php └── TestCase.php /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/.env.example -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/.gitattributes -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | .env 4 | .idea/ 5 | -------------------------------------------------------------------------------- /app/CQRS/DomainEventMessage.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/DomainEventMessage.php -------------------------------------------------------------------------------- /app/CQRS/EloquentEventStore/CreateEloquentEventStore.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EloquentEventStore/CreateEloquentEventStore.php -------------------------------------------------------------------------------- /app/CQRS/EloquentEventStore/DropEloquentEventStore.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EloquentEventStore/DropEloquentEventStore.php -------------------------------------------------------------------------------- /app/CQRS/EloquentEventStore/EloquentEventStoreModel.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EloquentEventStore/EloquentEventStoreModel.php -------------------------------------------------------------------------------- /app/CQRS/EloquentEventStore/EloquentEventStoreRepository.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EloquentEventStore/EloquentEventStoreRepository.php -------------------------------------------------------------------------------- /app/CQRS/EventSourcedEntity.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EventSourcedEntity.php -------------------------------------------------------------------------------- /app/CQRS/EventSourcedEntityInterface.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scazz/cqrs-tutorial/HEAD/app/CQRS/EventSourcedEntityInterface.php -------------------------------------------------------------------------------- /app/CQRS/EventSourcedEntityRepository.php: -------------------------------------------------------------------------------- 1 |