From d04fd4e8a1f1a053af004256ae1f3dc17ff32324 Mon Sep 17 00:00:00 2001 From: Luan Freitas Date: Mon, 8 Nov 2021 07:50:55 -0300 Subject: [PATCH] add custom payload to action emit --- resources/views/components/actions-header.blade.php | 7 ++++++- resources/views/components/actions.blade.php | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/views/components/actions-header.blade.php b/resources/views/components/actions-header.blade.php index 0a59963d..e104371c 100644 --- a/resources/views/components/actions-header.blade.php +++ b/resources/views/components/actions-header.blade.php @@ -9,9 +9,14 @@ @php $parameters = []; foreach ($action->param as $param => $value) { - $parameters[$param] = $row->{$value}; + if (!empty($row->{$value})) { + $parameters[$param] = $row->{$value}; + } else { + $parameters[$param] = $value; + } } @endphp + @if($action->event !== '') param as $param => $value) { - $parameters[$param] = $row->{$value}; + if (!empty($row->{$value})) { + $parameters[$param] = $row->{$value}; + } else { + $parameters[$param] = $value; + } } @endphp