效果
更改方式
在app/Admin/Actions/Grid/
下新建TextActions.php
檔案, 內容如下
<?php
namespace App\Admin\Actions\Grid;
use Dcat\Admin\Grid\Displayers\Actions;
class TextActions extends Actions
{
protected function getViewLabel()
{
$label = trans('admin.show');
return '<i class="feather icon-eye text-success"></i> <span class="text-success">' . $label . '</span>  ';
}
protected function getEditLabel()
{
$label = trans('admin.edit');
return '<i class="feather icon-edit-1 text-custom"></i> <span class="text-custom">' . $label . '</span>  ';
}
protected function getQuickEditLabel()
{
$label = trans('admin.edit');
$label2 = trans('admin.quick_edit');
return '<i class="feather icon-edit-1 text-custom"></i> <span class="text-custom" title="' . $label2 . '">' . $label . '</span>  ';
}
protected function getDeleteLabel()
{
$label = trans('admin.delete');
return '<i class="feather icon-alert-triangle text-danger"></i> <span class="text-danger">' . $label . '</span>  ';
}
}
在config/admin.php
中更改配置項grid.grid_action_class
, 如下
'grid_action_class' => App\Admin\Actions\Grid\TextActions::class,
參考文章: Dcat Admin 修改全域性行操作按鈕顯示方式為文字+圖示
本作品採用《CC 協議》,轉載必須註明作者和本文連結