Laravel-admin 用法

各大镜像链接


1. composer-laravel-镜像 
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/  

2.  加法 add()、
    减法 subtract()、
    乘法 multiply()、
    除法 divide()

3.  php artisan ide-helper:models
    php artisan ide-helper:generate

4.   //只读
   $form->text('from_address', '支付地址')->readonly();
    //show的使用 通过 as 可以使用模型关联调用数据
    $show->user_id('用户名')->as(function () {
            return $this->user->name;
        });

    //禁用行操作列
    $grid->disableActions();
    //禁用分页条
    $grid->disablePagination();
    //禁用创建按钮
    $grid->disableCreateButton();
    //禁用查询过滤器
    $grid->disableFilter();
    //禁用行选择checkbox
    $grid->disableRowSelector();
    //禁用
    $grid->disableTools();
    //禁用导出
    $grid->disableExport();
    //设置分页选择器选项
    $grid->perPages([10, 20, 30, 40, 50]);

    $grid->actions(function (Grid\Displayers\Actions        $actions) {
        $actions->disableView();
        $actions->disableEdit();
        $actions->disableDelete();
    });

5.     js swal 使用
$script = <<<SCRIPT
        $('button[type=submit]').on('click',function(e){
            event.preventDefault();
            swal({
                title: '请妥善保存好助记词!',
                text: '遗失后不能恢复!',
                type: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: '确认提交',
                cancelButtonText: "取消",
            }).then(function (isConfirm) {
                if (isConfirm.value == true ){
                     $("form").submit();
                }else{
                    event.preventDefault();
                    return false;
                }
            }).catch(swal.noop);
        });
SCRIPT;
                Admin::script($script);
本作品采用《CC 协议》,转载必须注明作者和本文链接
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!