chameleon2die4/wpbones-extend

此库为 WP Bones 框架添加了额外的功能。

1.0.8 2023-11-01 22:11 UTC

This package is auto-updated.

Last update: 2024-10-01 00:09:20 UTC


README

PHP Composer Latest Version Packagist PHP Version Require License

此库为 WP Bones 框架添加了额外的功能。

安装

Composer

进入目录并运行;

$ composer require chameleon2die4/wpbones-extend

您可以在更新依赖关系时配置您的 composer.json 以复制文件。

...
"scripts": {
    "post-update-cmd": [
        "Chameleon2die4\\WPBonesExtend\\WPBonesExtend::copyInitFiles"
    ]
},

如果您重命名插件 - 将 Chameleon2die4 更改为您的命名空间。

它会复制新的 bones 文件,以及新的命令。此外,还会复制命令的占位符模板。文件复制完成后,您可以从 composer.json 中删除这部分。

WP Bones 特性

新 bones 命令

make:service            Create a new Service
make:resource           Create a new Resource
make:meta               Create a new MetaBox

migrate:up              Run your migrations
migrate:rollback        Run rollback for your migrations

新迁移

    $this->create("your_table", function (Blueprint $table){
        $table->id();
        $table->integer('user_id')->nullable();
        $table->string('name');
        $table->string('link')->nullable();
    });