From f54a0f439b44fbb11c827f025024598dc323b889 Mon Sep 17 00:00:00 2001 From: Xavi Aparicio Date: Tue, 24 Oct 2023 12:08:42 +0200 Subject: [PATCH] Removed model relations from events payload --- Makefile | 4 ++++ src/Builders/EventMessageBuilder.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b581a6a..5d9740d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +.PHONY: phpunit +phpunit: + docker-compose run composer run phpunit + .PHONY: tests tests: docker-compose run composer run test diff --git a/src/Builders/EventMessageBuilder.php b/src/Builders/EventMessageBuilder.php index 8b1fb73..7ade355 100644 --- a/src/Builders/EventMessageBuilder.php +++ b/src/Builders/EventMessageBuilder.php @@ -20,7 +20,7 @@ public function build(Model $model, string $eventType): EventMessageInterface eventType: $eventType, modelName: $modelName, eventName: $modelName . ucfirst($eventType), - payload: $model->toArray(), + payload: $model->attributesToArray(), createdAt: Carbon::now()->toDateTimeString(), ); }