承接 shamaseen/laravel-files-generator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

shamaseen/laravel-files-generator

最新稳定版本:0.5.2

Composer 安装命令:

composer require shamaseen/laravel-files-generator

包简介

Generate any kind of File/s from stubs with only a single command, literally, ANY TYPE.

README 文档

README

Generate any kind of file/s from stubs with only a single command, literally, ANY KIND.



Build Licence

Quickstart


Generate a single file:

From command line:

php artisan generate:stub pathToStub.stub pathToOutput.extension --replace='key 1' --with='value 1' --replace="key 2" --with='value 2'

On runtime:

FilesGenerator::stub('PathToYourStubFile.extension') ->replace('string to be replaced','The replacement value') ->output('outputPath.extension');

Generate multiple files:

From command line:

php artisan generate:config 'pathToYourConfig/configFileName.php'

On runtime:

FilesGenerator::fromConfigFile('configPath.php');

Remove generated files from a config file:

From command line:

php artisan ungenerate:config 'pathToYourConfig/configFileName.php'

On runtime:

FilesUngenerator::fromConfigFile('configPath.php');

Installation

Run:

composer require shamaseen/laravel-files-generator 

Publish the package config file

php artisan vendor:publish --provider='Shamaseen\Generator\GeneratorServiceProvider'

Configuration files

To generate multiple files from config you will need to create a config file first, a config file is a php file that MUST return an array, either one-dimensional array or multi-dimensional array, depends on how many files you want to generate.

for example, to generate 2 files from 2 stubs with a single command, first create your conf:

<?php return [ [ 'stub' => 'first.stub', 'output' => 'first.generated', 'replace' => [ '{% to be replaced 1 %}' => 'value', '{% to be replaced 2 %}' => 'value' ] ], [ 'stub' => 'second.stub', 'output' => 'second.generated', 'replace' => [ '{% to be replaced 1 %}' => 'value', ] ] ];

now run this command to generate the two files:

php artisan generate:config 'pathToYourConfig/configFileName.php'

License

laravel files generator is a free software distributed under the terms of the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固