创建一个模块

未匹配的标注

create module

php artisan module:make AuthorVendor

php artisan module:make FooHello

create back-controller


php artisan module:make-back-controller FooHellos FooHello

create model and migration

php artisan module:make-back-model FooHello FooHello -m
Schema::create('foo_hellos', function (Blueprint $table) {
            $table->id();
            $table->string('name')->nullable();
            $table->timestamps();
        });
php artisan module:migrate FooHello

create Plugin.php

php artisan module:make-back-plugin FooHello

register side menu

in Plugin.php

public function registerSideNavSettings()
    {

        return [

            'foohellos' => [
                'label' => 'FooHello',
                'description' => '',
                'category' => 'FooHello',
                'icon' => 'icon-pencil',
                'url'         => Backend::url('foohello/foohellos'),
                'order' => 500,
                'context'=>['modules.foohello'],
                'keywords' => 'foohellos',
                'permissions' => [],
            ],
        ];
    }

config form

in Models/

fields.yaml

fields:

    name:
        label: Name

columns.yaml

columns:
    id:
        label: ID
        searchable: true
    name:
        label: Name
        searchable: true
        enableEdit: true
    action:
        label: 操作
        searchable: false
        sortable: false
        type: partial
        cssClass: flex border-dashed  border-gray-200    

visit yourdomain/backend/foohello/foohellos

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 0
发起讨论 查看所有版本


暂无话题~