当前位置:网站首页>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');
边栏推荐
- Character sets and comparison rules
- 服务器单、双向可调一键互信脚本!
- Bit operation n & (n-1), leetcode231, interview question 05.06
- See how I store integer data in the map < string, string > set
- Qixia housing and Urban Rural Development Bureau and fire rescue brigade carried out fire safety training
- MySQL 30 military regulations
- 【北邮果园微处理器设计】10 Serial Communication 串口通信笔记
- Update mysql5.6 to 5.7 under Windows
- MySQL 8th job
- 【在线仿真】Arduino UNO PWM 控制直流电机转速
猜你喜欢

2021 Q3-Q4 Kotlin Multiplatform 使用现状 | 调查报告
![[echart] i. how to learn echart and its characteristic document reading notes](/img/21/5405ae302df77d2ba07d9f5e5537f3.jpg)
[echart] i. how to learn echart and its characteristic document reading notes

Easyx-----c语言实现2048

Query online users and forced withdrawal users based on oauth2

Function run time

Linux下安裝Mysql【詳細】

02-Redis数据结构之链表

JWT (SSO scheme) + three ways of identity authentication

SVN 安装配置

Unity使用SteamVRPlugin时如何不让其他Camera位置和旋转收到SteamVRPlugin控制
随机推荐
8-图文打造LeeCode算法宝典-最小栈与LRU缓存机制算法题解
Mysql 30条军规
量化投资学习——经典书籍介绍
【在线仿真】Arduino UNO PWM 控制直流电机转速
【北邮果园微处理器设计】10 Serial Communication 串口通信笔记
搜索引擎高级搜索方法记录
Quantitative investment learning - Introduction to classic books
開發者,微服務架構到底是什麼?
9、 Beautify tables, forms, and hyperlinks
挖财商学院证券开户安全嘛?
Nuxt. JS - learning notes
RDB持久化验证测试
Vscode environment setup: synchronous configuration
UDP Flood攻击防御原理
Enter a positive integer with no more than 5 digits, and output the last digit in reverse order
栖霞市住建局和消防救援大队开展消防安全培训
滑动窗口
Redis (IV) redis association table caching
4、 Stacks and queues
[echart] II. User manual and configuration item reading notes