使用homestead环境,laravel框架代码初始化及使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tclzsn7456/article/details/88887896

建表/改表
php artisan make:migration create_xx_table
php artisan make:migration alert_xx_table

表迁移
php artisan migrate

生成控制器
php artisan make:controller Api\\XXXXApiController

生成模型
php artisan make:model Components\\Question\\Models\\XXXXX

生成仓库
php artisan make:repository \\App\\Components\\Question\\Repositories\\XXXXRepository

生成服务
php artisan make:service \\App\\Components\\Question\\Services\\XXXXService

生成单元测试
php artisan make:test Api\\Api1005Test

运行单元测试
./vendor/bin/phpunit tests/Feature/Api/Api1005Test

运行所有的单元测试
./vendor/bin/phpunit

生成队列
php artisan make:job XXXXX

运行队列
php artisan queue:work --queue=do_tasks

队列限制运行3次
php artisan queue:work --tries=3

查看错误log
/code/xxxx/storage/logs

生成命令
php artisan make:command XXXX

生成导入构造
php artisan make:import CareerTalkImport


装完homestead后记得装composer拉项目中的包

猜你喜欢

转载自blog.csdn.net/tclzsn7456/article/details/88887896