创建一个模块

未匹配的标注

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 网站上。

上一篇 下一篇
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 0
发起讨论 查看所有版本


暂无话题~