07-05
0
laravel
1.创建一个名为laravel的laravel项目
composer create-project laravel/laravel --prefer-dist ./QZ_20_0712
命令解释:
composer:表示执行该程序;
create-project :创建项目
laravel/laravel:需要创建的项目名称;
–prefer-dist:优先下载压缩包方式,而不是直接从GitHub上下载源码
2.php artisan
(1)数据表
//创建迁移 建表
php artisan make:migration create_demo_table
//重建数据库,在原本的迁移文件中增加字段后执行
php artisan migrate:refresh
//数据表迁移
php artisan migrate
//数据表回滚
php artisan migrate:rollback
(2)功能列表
php artisan list
(3)make 列表
make:cast Create a new custom Eloquent cast class
make:channel Create a new channel class
make:command Create a new Artisan command
make:component Create a new view component class
make:controller Create a new controller class
make:event Create a new event class
make:exception Create a new custom exception class
make:export Create a new export class
make:factory Create a new model factory
make:import Create a new import class
make:job Create a new job class
make:listener Create a new event listener class
make:mail Create a new email class
make:middleware Create a new middleware class
make:migration Create a new migration file
make:model Create a new Eloquent model class
make:notification Create a new notification class
make:observer Create a new observer class
make:policy Create a new policy class
make:provider Create a new service provider class
make:request Create a new form request class
make:resource Create a new resource
make:rule Create a new validation rule
make:seeder Create a new seeder class
make:test Create a new test class