1.laravel
简述 | 命令 |
查看laravel list命令帮助 | laravel --help | -h 或laravel list --help | -h |
查看laravel指定命令帮助 | laravel help <command> 或laravel <command> --help | -h |
查看Laravel Installer版本 | laravel --version | -V |
2.laravel list
简述 | 命令 |
查看laravel所有可用的命令 | laravel list |
3.laravel new
简述 | 命令 |
创建一个应用(根据提示操作) | laravel new <app> |
4.php artisan
简述 | 命令 |
查看php artisan list命令帮助 | php artisan --help | -h 或php artisan list --help | -h |
查看php artisan指定命令帮助 | php artisan help <command> 或php artisan <command> --help | -h |
查看Laravel Framework版本 | php artisan --verison | -V |
5.php artisan list
简述 | 命令 |
查看php artisan所有可用的命令 | php artisan list |
6.php artisan about/env
简述 | 命令 |
查看应用基本信息 | php artisan about |
查看应用环境 | php artisan env |
7.php artisan make
控制器类的类体为空,资源控制器类的类体包含 index()
、show()
、create()
、store()
、edit()
、update()
、destroy()
方法,但方法体都为空。
简述 | 命令 |
创建迁移文件 | php artisan make:migration create_articles_table |
创建模型类 | php artisan make:model Article |
创建模型类、迁移文件 | php artisan make:model Article --migration | -m |
创建模型类、控制器类 | php artisan make:model Article --controller | -c |
创建模型类、资源控制器类(id自动解析) | php artisan make:model Article --controller --resource | -cr |
创建控制器类 | php artisan make:controller ArticlesController |
创建资源控制器类(id不自动解析) | php artisan make:controller ArticlesController --resource |
创建资源控制器类(id自动解析)、模型类 | php artisan make:controller ArticlesController --model=Article [--resource] |
创建测试类 | php artisan make:test ArticleTest |
8.php artisan migrate
简述 | 命令 |
查看迁移文件状态 | php artisan migrate:status |
执行所有未运行的迁移文件 | php artisan migrate |
撤销最近一次migrate | php artisan migrate:rollback |
撤销最近几次migrate | php artisan migrate:rollback --step=5 |
撤销所有migrate | php artisan migrate:reset |
撤销所有migrate并重新执行migrate,等同于reset + migrate。 | php artisan migrate:refresh |
撤销最近几次migrate并重新执行migrate,等同于reset + migrate。 | php artisan migrate:refresh --step=5 |
删除数据库中的所有表并重新执行migrate。 | php artisan migrate:fresh |
9.php artisan schema
简述 | 命令 |
将 database/migrations 目录下的所有迁移文件“压缩”到 database/schema 目录下的名称为 <DB_CONNECTION>-schema 的 SQL 文件中,不删除 database/migrations 目录下的所有迁移文件。 | php artisan schema:dump |
将 database/migrations 目录下的所有迁移文件“压缩”到 database/schema 目录下的名称为 <DB_CONNECTION>-schema 的 SQL 文件中,删除 database/migrations 目录下的所有迁移文件。 | php artisan schema:dump --prune |
10.php artisan tinker
简述 | 命令 |
运行tinker | php artisan tinker |
11.php artisan test
简述 | 命令 |
运行测试 | php artisan test |
12.php artisan serve/up/down
简述 | 命令 |
启动应用 | php artisan serve |
使应用退出维护模式 | php artisan up |
将应用置于维护模式 | php artisan down |
13.php artisan db
简述 | 命令 |
连接到默认数据库连接的数据库CLI | php artisan db |
连接到指定数据库连接的数据库CLI | php artisan db <DB_CONNECTION> |
查看默认数据库连接的数据库信息 | php artisan db:show |
查看指定数据库连接的数据库信息 | php artisan db:show --database=<DB_CONNECTION> |
查看默认数据库连接的指定表的信息 | php artisan db:table <table> |
查看指定数据库连接的指定表的信息 | php artisan db:table <table> --database=<DB_CONNECTION> |
14.php artisan model
简述 | 命令 |
查看指定模型类的信息 | php artisan model:show Flight |
15.php artisan config
简述 | 命令 |
查看所有配置 | php artisan config:show |
创建配置缓存文件 | php artisan config:cache |
删除配置缓存文件 | php artisan config:clear |
16.php artisan route
简述 | 命令 |
查看所有路由 | php artisan route:list |
创建路由缓存文件 | php artisan route:cache |
删除路由缓存文件 | php artisan route:clear |
原创文章,作者:huoxiaoqiang,如若转载,请注明出处:https://www.huoxiaoqiang.com/php/phpenv/28562.html