laravel-admin隐藏按钮

$form


        //表单bottom
        $form->disableReset();
        $form->disableEditingCheck();
        $form->disableViewCheck();

        //表单右上角
        $form->tools(function (Form\Tools $tools) {
            $tools->disableDelete();
            $tools->disableView();
        });

$grid

	 // 表单右上角
	 	$grid->disableExport();
        $grid->disableCreation();
        // 操作按钮
        $grid->actions(function (Grid\Displayers\Actions $actions) {
            $actions->disableDelete();
            $actions->disableEdit();
            $resDemand = Demand::find($actions->getKey());
            $edit_html='';
            //通过
            if($resDemand->status==1){
                $edit_html.="";
  
            $actions->append($edit_html);
        });
//  批量操作
        $grid->tools(function (Grid\Tools $tools) {
            $tools->batch(function (Grid\Tools\BatchActions $actions) {
                $actions->disableDelete();
            });
        });

$show

        //表单右上角
        $show->panel()->tools(function ($tools){
            $tools->disableDelete();
            $tools->disableEdit();
        });

你可能感兴趣的:(laravel,PHP,laravel-admin)