Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
/ laravel-stubs Public archive

Editable templates for `artisan make:` commands

License

Notifications You must be signed in to change notification settings

LaravelRUS/laravel-stubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
atehnix
Jun 13, 2017
df52645 · Jun 13, 2017

History

14 Commits
Oct 19, 2016
Jun 13, 2017
Jun 13, 2017
Oct 19, 2016
Oct 19, 2016
Jun 13, 2017

Repository files navigation

Customize laravel make command

GitHub license Packagist Version

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.

Installation

You can get library through composer

composer require atehnix/laravel-stubs

Next up, the service provider Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,

should be replaced by ATehnix\LaravelStubs\Providers\ConsoleSupportServiceProvider::class,

// config/app.php

'providers' => [
    ...
    // Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    ATehnix\LaravelStubs\Providers\ConsoleSupportServiceProvider::class,
    ...
];

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

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.

Publish stub files for edit

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