public function confirm($id) { // Confirm changes using a command and a handler, again this would normally be done via mapping // and maybe split across some files. $command = new ConfirmPendingChangesCommand(TaskListId::fromString($id)); $this->taskListService->handleConfirmPendingChanges($command); return redirect()->route('lists.show', [$id, 'success' => true]); }
public function run() { $this->database->table(DbEventStore::TABLE)->truncate(); $startTaskList = new StartTaskListCommand(['Eat cake', 'Walk cake off', 'Rinse and repeat']); $this->service->handleStartTaskListCommand($startTaskList); $startTaskList = new StartTaskListCommand(['Read: Learn DDD', 'Read: Implementing DDD', 'Read: The data model resource book volume 1', 'Read: The data model resource book volume 2']); $this->service->handleStartTaskListCommand($startTaskList); $this->command->getOutput()->writeln("<info>Seeded:</info> Task Lists!"); }