In multiple locations the documentation for actions states, that the following works:
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
(new AccountData($model))->send($fields->subject);
}
}
Because the $models Collection comes back as JSON data only the following approach worked for me:
public function handle(ActionFields $fields, Collection $models)
{
AccountData::hydrate(json_decode($models, true))
->each(function ($accountData) {
$accountData->send();
});
}
EDIT: Getting the following error when trying to do it like in the docu:

Can you confirm this issue? Want to have a confirmation before making a PR on this