我想让生活变得更轻松,所以我创建了一个bash函数,当使用参数调用时,会创建一个新的Laravel项目,同时安装composer和一些软件包等等。
无论如何,我想知道是否有办法通过命令行更新config / app.php,这样我就不必手动编辑提供者和别名了?
这是脚本
function laranew(){
laravel new $1;
cd $1;
composer install;
composer require laravelcollective/html;
php artisan key:generate;
composer require barryvdh/laravel-debugbar;
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider";
}
编辑:正如Fabio建议的那样,我已相应地更新了脚本
function laranew(){
laravel new $1;
cd $1;
composer install;
composer require laravelcollective/html;
php artisan key:generate;
composer require barryvdh/laravel-debugbar;
php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider";
composer require barryvdh/laravel-ide-helper;
php artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config;
composer require doctrine/dbal;
cp ~/Code/app.php ~/Code/$1/config/app.php;
}