bajjouayoub/custom-commands

这个Laravel包可以帮助你在一条命令行中管理多个命令。

v1.6 2020-06-14 11:20 UTC

This package is auto-updated.

Last update: 2024-09-18 06:35:07 UTC


README

Github issues Software License

这个Laravel包可以帮助你在一条命令行中管理多个命令,如果你在使用Laravel Passport,这个包非常推荐。

安装

通过Composer安装此包。在终端运行以下命令

composer require bajjouayoub/custom-commands

然后发布配置文件

php artisan vendor:publish --provider="Bajjouayoub\CustomCommands\CustomCommandsServiceProvider"

工作原理

首先,前往 config 文件夹,并查找 custom-commands.php

指定命令的名称

"command_name" => "command:name"  

Output :

php artisan command:name

添加所有你希望一次性运行的命令

注意:这些命令应该是 string 类型

"commands" => [
    // 'config:clear'
    // 'migrate:refresh'
    // 'db:seed'
    // 'passport:install'
    ...
]

修改 .env 文件(可选)

如果你需要在 .env 文件中更改一些变量,将变量更改为 true,默认为 false

"change_env" => true

表格和行名称

如果你将 change_env 更改为 true,那么这些字段是必需的。变量 table 指的是 Laravel Passport 默认提供的 oauth_clients 表。变量 row 指的是 oauth_clients 表中的 secret 行。

"table" => "" //type of string


"row" => "" //type of string