当前位置:网站首页>Laravel admin hidden button, and set button display, default sequence, form form form non modifiable value
Laravel admin hidden button, and set button display, default sequence, form form form non modifiable value
2022-06-26 11:06:00 【siner. li】
Global concealment
stay bootstrap.php
in
use Encore\Admin\Form;
Form::init(function (Form $form) {
$form->tools(function (Form\Tools $tools) {
// Get rid of ` list ` Button
$tools->disableList();
// Get rid of ` Delete ` Button
$tools->disableDelete();
// Get rid of ` see ` Button
$tools->disableView();
});
$form->footer(function ($footer) {
// Get rid of ` see `checkbox
$footer->disableViewCheck();
// Get rid of ` continue editing `checkbox
$footer->disableEditingCheck();
// Get rid of ` Continue to create `checkbox
$footer->disableCreatingCheck();
});
});
\Encore\Admin\Show::init(function (Show $show) {
$show->panel()
->tools(function ($tools) {
$tools->disableEdit();
$tools->disableDelete();
});
});
// Remove the import
\Encore\Admin\Grid::init(function (\Encore\Admin\Grid $grid) {
$grid->disableExport();
});
Single module removal button
// Remove row selection
$grid->disableRowSelector();
// Remove the Add button
$grid->disableActions();
// Remove the operation button
$grid->disableActions();
// Disable the export data button
$grid->disableExport();
$grid->tools(function ($tools) {
$tools->batch(function ($batch) {
// Remove batch deletion
$batch->disableDelete();
});
});
Get rid of laravel Model time
public $timestamps = false;
Add button to header
//
$grid->tools(function (Grid\Tools $tools) {
$tools->append($this->html());
});
// After the current file
public function html()
{
return <<<HTML <a href="/admin/goods" class="btn btn-sm btn-success"> return </a> HTML;
}
show Model Remove the button
$show->panel()
->tools(function ($tools) {
$tools->disableEdit();
$tools->disableList();
$tools->disableDelete();
});
Sequence of rows
$grid->number(' Serial number ');
$grid->rows(function ($row, $number) {
$row->column('number', $number+1);
});
form The value cannot be modified
$form->display('column1');
边栏推荐
猜你喜欢
Detailed explanation of MySQL fuzzy query
机器学习聚类——实验报告
机器学习线性回归——实验报告
[Beiyou orchard microprocessor design] 10 serial communication serial communication notes
Unity使用SteamVRPlugin时如何不让其他Camera位置和旋转收到SteamVRPlugin控制
April 13, 2021 interview with beaver family
What does ack attack mean? How to defend against ack attacks?
How does unity prevent other camera positions and rotations from being controlled by steamvrplugin when using steamvrplugin
C language -- operators and expressions
Idea remote debugger
随机推荐
Easyexcel - Excel read / write tool
SQL index learning notes
Vscode environment setup: synchronous configuration
Installing MySQL under Linux [details]
即构「畅直播」上线!提供全链路升级的一站式直播服务
Reasons for "unresolved external symbols" during vs or QT compilation link:
Machine learning LDA - Experimental Report
mysql性能監控和sql語句
Execute Lua script in redis
最牛X的CMDB系统
Using baijiafan to automatically generate API calls: progress in JS (II)
loggie 编码以及换行符测试
Is it safe for compass software to buy stocks for trading? How to open an account to buy shares
近期工作汇报
Fabric. JS upper dash, middle dash (strikethrough), underline
携程机票 App KMM 跨端 KV 存储库 MMKV-Kotlin | 开源
深度理解STM32的串口实验(寄存器)【保姆级教程】
RDB persistence validation test
Recent work report
Oracle11g reports an error when starting the database ora-27154: post/wait create failed