defr/seeder_make-extension

Streams Platform 插件,扩展 `make:seeder` artisan 命令。

安装: 17

依赖: 0

建议者: 0

安全性: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:streams-addon

v1.0.3 2017-06-17 04:19 UTC

This package is auto-updated.

Last update: 2024-09-15 10:35:28 UTC


README

Streams Platform 插件。为 PyroCMS 提供的 seeder_make-extension

增强标准 make:seeder 命令。

特性

  • 需要选择插件;
  • 检查插件中可用的流;
  • 询问您想创建种子器的流;
  • 为插件创建一个种子器,并为每个选定的流创建一个种子器;
  • 包含配置存储库和主流存储库。

安装

步骤 1

运行

$ composer require defr/seeder_make-extension

添加到 require 部分的 composer.json

    "defr/seeder_make-extension": "~1.0.0",

运行 composer update 命令,这将安装扩展到 core 文件夹!

步骤 2

然后您需要将扩展安装到 PyroCMS

$ php artisan extension:install seeder_make

$ php artisan addon:install defr.extension.seeder_make

用法

可用选项

$ php artisan help make:seeder
Usage:
  make:seeder [options] [--] <namespace>

Arguments:
  namespace              The namespace of the addon

Options:
      --stream[=STREAM]  The stream slug.
      --shared           Indicates if the addon should be created in shared addons.
  -h, --help             Display this help message
  -q, --quiet            Do not output any message
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --env[=ENV]        The environment the command should run under
      --app[=APP]        The application the command should run under.
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

创建种子器

$ php artisan make:seeder defr.module.backup_manager

示例

生成的流种子器示例

<?php namespace Defr\BackupManagerModule\Dump;

use Defr\BackupManagerModule\Dump\Contract\DumpRepositoryInterface;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
use Illuminate\Contracts\Config\Repository;

class DumpSeeder extends Seeder
{

    /**
     * The Dump repository.
     *
     * @var DumpRepositoryInterface
     */
    protected $dumps;

    /**
     * The config repository.
     *
     * @var Repository
     */
    protected $config;

    /**
     * Create a new DumpSeeder instance.
     *
     * @param Repository $config
     * @param DumpRepositoryInterface $dumps
     */
    public function __construct(
        Repository $config,
        DumpRepositoryInterface $dumps
    )
    {
        $this->config = $config;
        $this->dumps = $dumps;
    }

    /**
     * Run the seeder
     */
    public function run()
    {

    }
}