muath-ic / artisan-command-alias
定义 Laravel Artisan 命令的别名
dev-master
2020-01-01 10:18 UTC
Requires
- php: ^7.1
- illuminate/console: 5.6.*
- illuminate/support: 5.6.*
Requires (Dev)
- orchestra/testbench: ^3.6
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-09-29 05:29:01 UTC
README
此包允许您为 Artisan 创建一些别名。就像 bash
,但用于 Artisan。
安装
您可以通过 composer 安装此包
composer require muath-ic/artisan-command-alias
用法
首先,您需要使用以下命令发布配置文件,该文件存储了所有可用的别名:
php artisan vendor:publish --provider="muath-ic\CommandAlias\ArtisanCommandAliasServiceProvider"
现在,编辑 config/artisan-command-alias.php
并创建您的配置,如下所示:
<?php /* * Configuration file for CommandAlias package */ return [ /* * Register all your alias in the next array. You can use string association * if there's no argument. * * https://laravel.net.cn/docs/5.6/artisan#programmatically-executing-commands */ 'commands' => [ 'i' => 'inspire', 'lsr' => ['route:list', ['--reverse' => true]], ] ];
您可以为 Artisan 创建一个 bash
别名,例如 alias a="php artisan"
,然后执行命令如 a i
或 a lsr
,就像使用 git
一样(alias g="git"
; g lga
)。
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件。