connor-lock05/laravel-bundles 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

connor-lock05/laravel-bundles

最新稳定版本:1.0.2

Composer 安装命令:

composer require connor-lock05/laravel-bundles

包简介

Developer package to improve make commands for common 'bundles' of files

README 文档

README

Laravel Bundles is a development package that aims to make creating files using artisan commands easier. It achieves this by defining preset 'bundles' in a bundles config file.

Publish Config

To publish the bundles config file run:

php artisan vendor:publish --tag=bundles-config

This will create a config file that looks like this:

<?php

use ConnorLock05\LaravelBundles\Data\Makeables;

return [

    /*
    |--------------------------------------------------------------------------
    | Bundles
    |--------------------------------------------------------------------------
    |
    | This value is where you can define your bundles.
    | Add an array key with an associated array of files to make
    |
    | Example: Creates a Model, Controller and Create Migration
    |
    */
    'bundles' => [
        'example' => [
            Makeables::Model,
            Makeables::Controller,
            Makeables::Migration,
        ],
    ],

];

The bundles array is where you can define your bundles. The array key is the name, and the value is an array of Makeables.

Example Definition

An example definition for a bundle would be:

use ConnorLock05\LaravelBundles\Data\Makeables;

'CRUD Item' => [
    Makeables::Model,
    Makeables::ResourceController,
    Makeables::Migration,
    Makeables::Policy,
],

Turing the config file into:

<?php

use ConnorLock05\LaravelBundles\Data\Makeables;

return [

    /*
    |--------------------------------------------------------------------------
    | Bundles
    |--------------------------------------------------------------------------
    |
    | This value is where you can define your bundles.
    | Add an array key with an associated array of files to make
    |
    | Example: Creates a Model, Controller and Create Migration
    |
    */
    'bundles' => [
        'example' => [
            Makeables::Model,
            Makeables::Controller,
            Makeables::Migration,
        ],
        'CRUD Item' => [
            Makeables::Model,
            Makeables::ResourceController,
            Makeables::Migration,
            Makeables::Policy,
],
    ],

];

This bundle will create a Model, Controller (with the --resource option), migration and a policy

Making a Bundle

To make a defined bundle, simply run:

php artisan make:bundle

This will then present you with a list of defined bundles. Move to the one you want with the arrow keys and select with enter. Each Makeable will then be triggered and prompt the user to enter details about the Makeable.

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-19