Skip to content

Commit

Permalink
Merge pull request #1715 from bakaphp/feat-message-workflow
Browse files Browse the repository at this point in the history
refact: when they seng strigify message
  • Loading branch information
kaioken authored Jul 21, 2024
2 parents 94c8664 + 291a2de commit eadd08a
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 eadd08a

Please sign in to comment.