当前位置:网站首页>laravel-admin隐藏按钮, 及设置按钮显示, 默认序列, form 表单的不可修改值
laravel-admin隐藏按钮, 及设置按钮显示, 默认序列, form 表单的不可修改值
2022-06-26 10:04:00 【siner.li】
全局隐藏
在 bootstrap.php 中
use Encore\Admin\Form;
Form::init(function (Form $form) {
$form->tools(function (Form\Tools $tools) {
// 去掉`列表`按钮
$tools->disableList();
// 去掉`删除`按钮
$tools->disableDelete();
// 去掉`查看`按钮
$tools->disableView();
});
$form->footer(function ($footer) {
// 去掉`查看`checkbox
$footer->disableViewCheck();
// 去掉`继续编辑`checkbox
$footer->disableEditingCheck();
// 去掉`继续创建`checkbox
$footer->disableCreatingCheck();
});
});
\Encore\Admin\Show::init(function (Show $show) {
$show->panel()
->tools(function ($tools) {
$tools->disableEdit();
$tools->disableDelete();
});
});
// 去掉导入
\Encore\Admin\Grid::init(function (\Encore\Admin\Grid $grid) {
$grid->disableExport();
});
单个模块去除按钮
// 去掉行选择
$grid->disableRowSelector();
// 去掉增加按钮
$grid->disableActions();
// 去掉操作按钮
$grid->disableActions();
//禁用导出数据按钮
$grid->disableExport();
$grid->tools(function ($tools) {
$tools->batch(function ($batch) {
// 去掉批量删除
$batch->disableDelete();
});
});
去掉laravel 模型的时间
public $timestamps = false;
表头添加按钮
//
$grid->tools(function (Grid\Tools $tools) {
$tools->append($this->html());
});
// 当前文件的后面
public function html()
{
return <<<HTML <a href="/admin/goods" class="btn btn-sm btn-success">返回</a> HTML;
}
show 模型 去除按钮
$show->panel()
->tools(function ($tools) {
$tools->disableEdit();
$tools->disableList();
$tools->disableDelete();
});
行的序列
$grid->number('序号');
$grid->rows(function ($row, $number) {
$row->column('number', $number+1);
});
form 不可修改值
$form->display('column1');
边栏推荐
- 【北邮果园微处理器设计】10 Serial Communication 串口通信笔记
- consul微服务治理中心踩坑
- Redis中执行Lua脚本
- 8- creating leecode algorithm with pictures and texts - algorithm solution of minimum stack and LRU caching mechanism
- Alibaba cloud OSS - object storage service (tool)
- 在Oracle中update大量数据会不会导致undo空间爆掉
- Expand and collapse too high div
- Is it safe for compass software to buy stocks for trading? How to open an account to buy shares
- c语言 --- 运算符和表达式
- JWT certification agreement -- I opened a Yihong hospital
猜你喜欢

2021 Q3-Q4 Kotlin Multiplatform 使用现状 | 调查报告

c语言 --- 运算符和表达式

JS take the date of the previous month 【 pit filling 】

Linux下安装Mysql【详细】

Vscode environment setup: synchronous configuration

Redis (basic) - learning notes

【深度学习理论】(6) 循环神经网络 RNN

Docker中实现MySQL主从复制

Developers, what is the microservice architecture?

【北邮果园微处理器设计】10 Serial Communication 串口通信笔记
随机推荐
Swiftui development experience: data layer of application design for offline priority
Using reflection to export entity data to excel
Alibaba cloud OSS - object storage service (tool)
AIX基本操作记录
Tape library simple record 1
Redis (basic) - learning notes
nacos2.x.x启动报错信息Error creating bean with name ‘grpcClusterServer‘;
搜索引擎高级搜索方法记录
【深度学习理论】(6) 循环神经网络 RNN
Expand and collapse too high div
指南针软件买股票进行交易安全吗?怎么开户买股票
UDP Flood攻击防御原理
Is it safe to open an account in the school of Finance and business?
Origin of b+ tree index
AIX basic operation record
Postman入门教程
代码规范 & 详细解释 husky、prettier、eslint、lint-staged 的作用和使用
Installer MySQL sous Linux [détails]
Cereals Mall - Distributed Advanced
近期工作汇报