php artisan 命令列表

php  artisan 命令列表

Options:                //选项
  -h, --help            //显示此帮助消息
  -q, --quiet           //不输出任何消息
  -V, --version         //显示此应用程序版本
      --ansi            //强制ANSI输出
      --no-ansi         //禁用ANSI输出
  -n, --no-interaction  //不要问任何互动的问题
      --env[=ENV]       //命令运行的环境
  -v|vv|vvv, --verbose  //增加消息的冗余度:1用于正常输出,2用于更详细的输出,3用于调试

Available commands:    //可用命令
  clear-compiled       //删除编译后的类文件
  down                 //将应用程序置于维护模式
  env                  //显示当前框架环境
  help                 //显示命令的帮助
  inspire              //随机输出一条名人名言
  list                 //命令列表
  migrate              //运行数据库迁移
  optimize             //缓存框架引导文件
  serve                //在PHP开发服务器上提供应用程序
  test                 //运行应用程序测试
  tinker               //与应用程序交互
  up                   //使应用程序脱离维护模式
 auth                  //认证
  auth:clear-resets    //刷新过期的密码重置令牌
 cache                 //缓存
  cache:clear          //刷新应用程序缓存
  cache:forget         //从缓存中删除一项
  cache:table          //为缓存数据库表创建迁移
 config                //配置
  config:cache         //创建一个缓存文件以更快地加载配置
  config:clear         //移除缓存的配置文件
 db                    //数据库操作
  db:seed              //在数据库中添加记录 数据库生成模拟数据
  db:wipe              //删除所有表、视图和类型
 event                 //事件
  event:cache          //查找并缓存应用程序的事件和侦听器
  event:clear          //清除所有缓存的事件和侦听器
  event:generate       //基于regist生成丢失的事件和侦听器
ration
  event:list           //列出应用程序的事件和侦听器
 ide-helper            //ide帮助
  ide-helper:eloquent  Add \Eloquent helper to \Eloquent\Model
  ide-helper:generate  //自动为 Laravel 的 Facades 生成注释#
  ide-helper:meta      //为PhpStorm生成元数据
  ide-helper:models    //为数据模型生成注释
 key                   //密钥 
  key:generate         //设置应用程序键 生成的密钥key值
 make                  //创建
  make:cast            //创建一个新的自定义Eloquent转换类
  make:channel         //创建一个新的channel类
  make:command         //创建一个新的命令处理程序类
  make:component       //创建一个新的视图组件类
  make:controller      //创建一个新的控制器类
  make:event           //创建一个新的事件类
  make:exception       //创建一个新的自定义异常类
  make:factory         //创建一个新的模型工厂
  make:job             //创建一个新的job类
  make:listener        //创建一个新的事件侦听器类
  make:mail            //创建一个新的电子邮件类
  make:middleware      //创建一个新的中间件类
  make:migration       //创建一个新的迁移文件
  make:model           //创建一个Eloquent 模型类  
  make:notification    //创建一个新的通知类
  make:observer        //创建一个新的观察者类
  make:policy          //创建一个新的policy类
  make:provider        //创建一个新的服务提供程序类
  make:request         //创建一个新的表单请求类
  make:resource        //创建一个新资源
  make:rule            //创建一个新的验证规则
  make:seeder          //创建一个新的seeder类
  make:test            //创建一个新的测试类
 migrate               //迁移
  migrate:fresh        //删除所有表并重新运行所有迁移
  migrate:install      //创建迁移存储库
  migrate:refresh      //重置并重新运行所有迁移
  migrate:reset        //回滚所有数据库迁移
  migrate:rollback     //回滚最后一次数据库迁移
  migrate:status       //显示每个迁移的状态
 notifications
  notifications:table  //为通知表创建一个迁移
 optimize
  optimize:clear       //删除缓存的引导文件
 package
  package:discover     //重新生成缓存的包清单
 queue                 //队列
  queue:failed         //列出所有失败的队列工作
  queue:failed-table   //为失败队列作业数据库表创建迁移
  queue:flush          //刷新所有失败的队列工作
  queue:forget         //删除失败的队列工作
  queue:listen         //监听给定队列
  queue:restart        //在队列工作进程的当前任务完成后重新启动它们
  queue:retry          //重试失败的队列工作
  queue:table          //创建一个迁移的队列数据库工作表 
  queue:work           //作为守护进程开始处理队列上的作业
 route                 //路由
  route:cache          //创建一个更快的路由注册的路由缓存文件
  route:clear          //删除路由缓存文件
  route:list           //列出所有已注册的路由
 schedule
  schedule:run         //运行计划命令
 session
  session:table        //为会话数据库表创建一个迁移
 storage
  storage:link         //创建为应用程序存根配置的符号链接
  stub:publish         //发布所有可用于定制的存根
 vendor
  vendor:publish       //从供应商包中发布任何可发布的资产
 view
  view:cache           //编译应用程序的所有刀片模板
  view:clear           //清除所有已编译的视图文件

全局命令:

//查看artisan命令
php artisan
php artisan list

//查看某个帮助命令
php artisan help make:model

//查看laravel版本
php artisan --version

//使用PHP内置的开发服务器启动应用
php artisan serve

//生成一个随机的key,并自动更新到app/config/app.php的key键值对
php artisan key:generate

//开启Auth用户功能(开启后需要执行迁移才生效)
php artisan make:auth

//开启维护模式和关闭维护模式(显示503)
php artisan down
php artisan up

//进入tinker工具
php artisan tinker

//列出所有路由
php artisan route:list

//生成路由缓存以及一处缓存路由文件
php artisan route:cache
php artisan route:clear

常用功能命令:

//创建控制器
php artisan make:controller StudentController

//创建Rest风格资源控制器(带有index,create,store,edit,update,destroy,show方法)
php artisan make:controller PhotoController --resource

//创建模型
php artisan make:model Student

//创建新建表的迁移和修改表的迁移
php artisan make:migration create_users_table --create=students//创建students表
php artisan make:migration add_votes_to_users_table --table=students//给students表增加votes字段

//执行迁移
php artisan migrate

//创建模型的时候同时生成新建表的迁移
php arisan make:model Student -m

//回滚上一次迁移
php artisan migrate:rollback

//回滚所有迁移
php artisan migrate:reset

//创建填充
php artisan make:seeder StudentTableSeeder

//执行单个填充
php artisan db:seed --class=StudentTableSeeder

//执行所有填充
php artisan db:seed

//创建中间件(app/Http/Middleware下)
php artisan make:middleware Activity

//创建队列(数据库)的表迁移(需要执行迁移才生效)
php artisan queue:table

//创建队列类(app/jobs下)
php artisan make:job SendEmail

//创建请求类(app/Http/Requests下)
php artisan make:request CreateArticleRequest

猜你喜欢

转载自blog.csdn.net/tang242424/article/details/108220169