Skip to content

Commit

Permalink
refact: when they seng strigify message
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken committed Jul 21, 2024
1 parent 6816d07 commit 291a2de
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function execute(Model $message, AppInterface $app, array $params): array
return ['No field configured to generate slug'];
}

$fieldToSlug = $message->message[$slugField] ?? null;
$messageData = is_array($message->message) ? $message->message : (Str::isJson($message->message) ? json_decode($message->message, true) : []);
$fieldToSlug = $messageData[$slugField] ?? null;

if ($fieldToSlug === null) {
return ['No slug field {' . $slugField . ' found in message ' . $message->id];
Expand Down

0 comments on commit 291a2de

Please sign in to comment.