diff --git a/app/Services/DatatableService.php b/app/Services/DatatableService.php index 5a1fd279ae..63fe47005b 100644 --- a/app/Services/DatatableService.php +++ b/app/Services/DatatableService.php @@ -41,6 +41,7 @@ class DatatableService private function createDropdown($entityType, $table, $actions) { $table->addColumn('dropdown', function ($model) use ($entityType, $actions) { + $hasAction = false; $str = '
'; if (property_exists($model, 'is_deleted') && $model->is_deleted) { @@ -70,6 +71,7 @@ class DatatableService if ($visible($model)) { $str .= "
  • {$value}
  • "; $lastIsDivider = false; + $hasAction = true; } } elseif ( ! $lastIsDivider) { $str .= "
  • "; @@ -77,6 +79,10 @@ class DatatableService } } + if ( ! $hasAction) { + return ''; + } + if ( ! $lastIsDivider) { $str .= "
  • "; }