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
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-08