定制 vleroy/laravel-gen 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

vleroy/laravel-gen

最新稳定版本:1.0.1

Composer 安装命令:

composer require vleroy/laravel-gen

包简介

Laravel Gen

README 文档

README

Simple files generator used to easily create multiple files at once.

Installation

The package can be installed using composer.

composer require --dev vleroy/laravel-gen

Usage

# This will prompt you for {replacement values} found in folder's files
php artisan gen <folder name>

Files structure

The files structure in the resources/templates/<folder> folder will be replicated in the root folder of the project.

├── app
│   ├── ...
├── artisan
├── bootstrap
│   ├── ...
├── composer.json
├── config
│   ├── ...
├── database
│   ├── ...
├── public
│   ├── ...
├── resources
│   ├── ...
│   ├── templates
│   │   └── Model
│   │       ├── app
│   │       │   ├── Http
│   │       │   │   └── Controllers
│   │       │   │       └── {ModelName}Controller.php
│   │       │   ├── Models
│   │       │   │   └── {ModelName}.php
│   │       │   └── Services
│   │       │       └── {ModelName}Service.php
│   │       └── routes
│   │           └── {model_name}.php
├── routes
│   ├── ...
├── server.php
├── storage
│   ├── ...

Example

Artisan

  • The {my_value} pattern indicates a dynamic value.
  • The command php artisan <folder> will prompt you for a replacement value.
  • These replacement values can be used in paths and in files content.
$ php artisan gen Model                                                          

 ModelName:
 > Post

 model_name:
 > post

 model_table:
 > posts

Destination file

<?php
// Source -> resources/templates/Model/app/Models/{ModelName}.php
// Destination -> app/Models/Post.php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    protected $table = "posts";
    
    ...
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固