diff --git a/app/View/Components/DeleteButton.php b/app/View/Components/DeleteButton.php index 41634d989..0a7b128c0 100644 --- a/app/View/Components/DeleteButton.php +++ b/app/View/Components/DeleteButton.php @@ -189,7 +189,7 @@ class DeleteButton extends Component protected function getMessage($cancelText) { - if (!empty($cancelText)) { + if (! empty($cancelText)) { return $cancelText; } @@ -207,6 +207,7 @@ class DeleteButton extends Component $text = $this->text ? $this->text : $page; $name = addslashes($this->model->{$this->modelName}); + $name = Str::replace(['\"', '"'], '"', $name); $type = mb_strtolower($this->getModelTitle()); @@ -251,7 +252,7 @@ class DeleteButton extends Component protected function getCancelText($cancelText) { - if (!empty($cancelText)) { + if (! empty($cancelText)) { return $cancelText; } @@ -260,7 +261,7 @@ class DeleteButton extends Component protected function getDeleteText($deleteText) { - if (!empty($deleteText)) { + if (! empty($deleteText)) { return $deleteText; } diff --git a/app/View/Components/DeleteLink.php b/app/View/Components/DeleteLink.php index 6989deeb4..52c9cdee7 100644 --- a/app/View/Components/DeleteLink.php +++ b/app/View/Components/DeleteLink.php @@ -219,6 +219,7 @@ class DeleteLink extends Component $text = $this->text ? $this->text : $page; $name = addslashes($this->model->{$this->modelName}); + $name = Str::replace(['\"', '"'], '"', $name); $type = mb_strtolower($this->getModelTitle()); @@ -263,7 +264,7 @@ class DeleteLink extends Component protected function getCancelText($cancelText) { - if (!empty($cancelText)) { + if (! empty($cancelText)) { return $cancelText; } @@ -272,7 +273,7 @@ class DeleteLink extends Component protected function getDeleteText($deleteText) { - if (!empty($deleteText)) { + if (! empty($deleteText)) { return $deleteText; } diff --git a/resources/views/components/table/actions.blade.php b/resources/views/components/table/actions.blade.php index 2f48b9c9f..77ca1af84 100644 --- a/resources/views/components/table/actions.blade.php +++ b/resources/views/components/table/actions.blade.php @@ -101,8 +101,12 @@ @case('delete') @php $divider = false; @endphp - @php $title = $action['title'] ?? null; @endphp - + @php + $title = $action['title'] ?? null; + $modelId = ! empty($action['model-id']) ? $action['model-id'] : 'id'; + $modelName = ! empty($action['model-name']) ? $action['model-name'] : 'name'; + @endphp + @break @case('divider')