You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aquaculture/app/Admin/Actions/Post/DividerAction.php

39 lines
1005 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace App\Admin\Actions\Post;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;
class DividerAction extends RowAction
{
// 动作名称,显示在界面上的按钮文本
public $name = '分隔线';
/**
* 处理分隔线的逻辑
*
* @param Model $model 当前行的模型实例
* @return \Encore\Admin\Actions\Response 返回操作结果的响应
*/
public function handle(Model $model)
{
// 此处可以添加处理逻辑,当前实现中不执行任何操作
// 例如,可以记录日志或执行其他操作
// 返回成功响应并刷新页面
return $this->response()->success('Success message.')->refresh();
}
/**
* 渲染行操作的HTML
*
* @return string 返回HTML字符串用于显示分隔线
*/
public function render()
{
// 返回一个包含分隔线的列表项HTML
return '<li class="divider"></li>';
}
}