1. Go to this page and download the library: Download lswl/laravel-console library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lswl / laravel-console example snippets
php artisan vendor:publish --tag=lswl-console
// 创建 Test 控制器位于 app/Http/Controllers/Test.php
php artisan lswl:make-controller test
// 创建 Test 控制器修改继承父类
php artisan lswl:make-controller test --controller-extends App/BaseController
// 创建 Test 控制器并添加后缀,位于 app/Http/Controllers/TestController.php
php artisan lswl:make-controller test -s
...
// 创建公用模型位于 app/Common/Models 并排除 test,foos 表
php artisan lswl:make-model --dir Common/Models -t test -t foos
// 创建 Test 模型位于 app/Http/Models/Test.php
php artisan lswl:make-model test
// 创建 Test 模型修改继承父类
php artisan lswl:make-model test --model-extends App\BaseModel
// 创建 Test 模型并添加后缀,位于 app/Http/Models/TestModel.php
php artisan lswl:make-model test -s
...
// 创建 Test 服务位于 app/Http/Services/Test.php
php artisan lswl:make-service test
// 创建 Test 服务修改继承父类
php artisan lswl:make-service test --service-extends App\BaseService
// 创建 Test 服务并添加后缀,位于 app/Http/Services/TestService.php
php artisan lswl:make-service test -s
...
// 创建 Test 验证器位于 app/Http/Validates/Test.php
php artisan lswl:make-validate test
// 创建 Test 验证器修改继承父类
php artisan lswl:make-validate test --validate-extends App/BaseValidate
// 创建 Test 验证器并添加后缀,位于 app/Http/Validates/TestValidate.php
php artisan lswl:make-validate test -s
...
// 创建 Test 数据访问位于 app/Http/Daos/Test.php
php artisan lswl:make-dao test
// 创建 Test 数据访问修改继承父类
php artisan lswl:make-dao test --dao-extends App/BaseDao
// 创建 Test 数据访问并添加后缀,位于 app/Http/Daos/TestDao.php
php artisan lswl:make-dao test -s
...