Fixed delete link message issue solved..

This commit is contained in:
Cüneyt Şentürk 2022-06-02 18:45:38 +03:00
parent ff351be76e
commit a13d60ad64
3 changed files with 13 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -101,8 +101,12 @@
@case('delete')
@php $divider = false; @endphp
@php $title = $action['title'] ?? null; @endphp
<x-delete-link :model="$action['model']" :route="$action['route']" :text="$title" />
@php
$title = $action['title'] ?? null;
$modelId = ! empty($action['model-id']) ? $action['model-id'] : 'id';
$modelName = ! empty($action['model-name']) ? $action['model-name'] : 'name';
@endphp
<x-delete-link :model="$action['model']" :route="$action['route']" :text="$title" :model-id="$modelId" :model-name="$modelName" />
@break
@case('divider')