项目作者: LaravelRUS

项目描述 :
Editable templates for `artisan make:` commands
高级语言: PHP
项目地址: git://github.com/LaravelRUS/laravel-stubs.git
创建时间: 2016-10-19T05:49:07Z
项目社区:https://github.com/LaravelRUS/laravel-stubs

开源协议:MIT License

下载


Customize laravel make command

GitHub license
Packagist Version
Packagist Stats

The package gives you the opportunity to customize Artisan commands like artisan make:model, artisan make:controller and other, just as you need.

Any location of the generated classes and with any content.

Only Laravel 6 or less is supported.

The laravel-stubs functionality (partially) is now added as part of the Laravel framework (v7).

The laravel-stubs package remains available as an implementation of this functionality for previous versions of the framework, but will not be updated for new versions of Laravel.

Installation

For laravel v5.4 or older see: older installation

You can get library through composer

  1. composer require atehnix/laravel-stubs

To publish the config file to config/stubs.php run:

  1. php artisan vendor:publish --provider="ATehnix\LaravelStubs\Providers\ConsoleSupportServiceProvider"

Done!

Usage

Configure paths for generated classes

To change the paths of saving the generated classes, you need to configure their namespaces in a configuration file config/stubs.php.

Modular development.

If you have a large project, you may want to divide it into modules as subdirectories in the “app” directory.

To make classes inside the module you are developing, you can specify the name of the module in the STUBS_MODULE environment variable.

Publish stub files for edit

  1. php artisan stubs:publish

The files will be placed in the directory resources/stubs (or other directory if you change it in the configuration file).

Now you can edit any of the stubs and enjoy your customized commands like artisan make:model,artisan make:controller and others.

License

MIT