本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/3

首先我们通过php artisan list命令可以看到我们所有可以执行的artisan命令,如下图所示:

接下来我们找一些常用的命令进行整理一下

一、auth

#1.清除过期的密码重置密钥;Flush expired password reset tokens
php artisan auth:clear-resets

二、backup

#1.删除配置中超过指定天数的所有备份;Remove all backups older than specified number of days in config
php artisan backup:clean
#2. 显示所有备份的列表;Display a list of all backups
php artisan backup:list
#3. 监控所有备份的运行状况;Monitor the health of all backups
php artisan backup:monitor
#4. 运行备份;Run the backup
php artisan backup:run

三、cache

#1.清除应用程序缓存;Flush the application cache
php artisan cache:clear
#2.从缓存中删除项目,通常指文件、redis等缓存;Remove an item from the cache
php artisan cache:forget
#3. 创建一个缓存数据库表的迁移;Create a migration for the cache database table
php artisan cache:table

四、config

#1. 刷新应用程序缓存;Flush the application cache
php artisan config:cache
#2.从缓存中删除一个项;Remove an item from the cache
php artisan config:clear

五、db

#1. 在数据库中添加记录;Seed the database with records
php artisan db:seed
#2. 删除所有表、视图和类型;Drop all tables, views, and types
php artisan db:wipe

六、dusk

#1.安装ChromeDriver二进制文件;Install the ChromeDriver binary
php artisan dusk:chrome-driver
#2.创建一个新的Dusk组件类;Create a new Dusk component class
php artisan dusk:component
#3.从上次运行开始运行失败的Dusk测试,并在失败时停止;Run the failing Dusk tests from the last run and stop on failure
php artisan dusk:fails
#4.将Dusk安装到应用程序中;Install Dusk into the application
php artisan dusk:install
#5.创建一个新的Dusk测试类;Create a new Dusk test class
php artisan dusk:make
#6.创建一个新的Dusk页面类;Create a new Dusk page class
php artisan dusk:page
#7.清除Dusk测试调试文件;Purge dusk test debugging files
php artisan dusk:purge

五、event

#1.发现并缓存应用程序的事件和侦听器;Discover and cache the application's events and listeners
php artisan event:cache
#2.清除所有缓存的事件和侦听器;Clear all cached events and listeners
php artisan event:clear
#3.根据注册生成丢失的事件和侦听器;Generate the missing events and listeners based on registration
php artisan event:generate
#4.列出应用程序的事件和侦听器;List the application's events and listeners
php artisan event:list

六、ide-helper

#1.将\Eloquent helper添加到\Eloquent\模型中;Add \Eloquent helper to \Eloquent\Model
php artisan ide-helper:eloquent
#2.生成一个新的IDE Helper文件; Generate a new IDE Helper file.
php artisan ide-helper:generate
#3.为PhpStorm生成元数据;Generate metadata for PhpStorm
php artisan ide-helper:meta
#4.为模型生成自动完成;Generate autocompletion for models
php artisan ide-helper:models

七、key

#1. 设置应用秘钥;Set the application key
php artisan key:generate

九、make

#1. 创建一个新的自定义Eloquent转换类;Create a new custom Eloquent cast class
php artisan make:cast
#2. 创建一个新的通道类;Create a new channel class
php artisan make:channel
#3. 创建一个新的Artisan命令;Create a new Artisan command
php artisan make:command
#4. 创建一个新的视图组件类;Create a new view component class
php artisan make:component
#5. 创建一个新的控制器类;Create a new controller class
php artisan make:controller
#6. 创建一个新的事件类;Create a new event class
php artisan make:event
#7.创建一个新的自定义异常类;Create a new custom exception class
php artisan make:exception
#8.创建一个新的模型工厂;Create a new model factory
php artisan make:factory
#9.创建一个新的作业类;Create a new job class
php artisan make:job
#10.创建一个新的事件侦听器类;Create a new event listener class
php artisan make:listener
#10. 创建一个新的电子邮件类;Create a new email class
php artisan make:mail
#11. 创建一个新的中间件类;Create a new middleware class
php artisan make:middleware
#12. 创建一个新的迁移文件;Create a new migration file
php artisan make:migration
#13. 创建一个新的Eloquent模型类;Create a new Eloquent model class
php artisan make:model
#14. 创建一个新的通知类;Create a new notification class
php artisan make:notification
#15. 创建一个新的观察者类;Create a new observer class
php artisan make:observer
#16. 创建一个新的策略类;Create a new policy class
php artisan make:policy
#17. 创建一个新的服务提供者类;Create a new service provider class
php artisan make:provider
#18. 创建一个新的表单请求类;Create a new form request class
php artisan make:request
#19. 创建一个新资源;Create a new resource
php artisan make:resource
#20. 创建新的验证规则;Create a new validation rule
php artisan make:rule
#21. 创建一个新的播种者类;Create a new seeder class
php artisan make:seeder
#22. 创建一个新的测试类;Create a new test class
php artisan make:test

十、migrate

#1. 删除所有表并重新运行所有迁移;Drop all tables and re-run all migrations
php artisan migrate:fresh
#2. 创建迁移存储库;Create the migration repository
php artisan migrate:install
#3. 重置并重新运行所有迁移;Reset and re-run all migrations
php artisan migrate:refresh
#4. 回滚所有数据库迁移;Rollback all database migrations
php artisan migrate:reset
#5. 回滚最后一次数据库迁移;Rollback the last database migration
php artisan migrate:rollback
#6. 显示每个迁移的状态;Show the status of each migration
php artisan migrate:status

十一、modelCache

#1. 刷新给定模型的缓存。如果没有模型给定,整个模型缓存被刷新;Flush cache for a given model. If no model is given, entire model-cache is flushed.
php artisan modelCache:clear
#2. 发布“模型缓存Laravel”包的各种依赖包; Publish various assets of the 'Model Caching for Laravel' package
php artisan modelCache:publish

十二、notifications

#1. 为通知表创建迁移;Create a migration for the notifications table
php artisan notifications:table

十三、opcache

#1.  清除OPCache;Clear OPCache
php artisan opcache:clear
#2. 预编译应用程序代码;Pre-compile your application code
php artisan opcache:compile
#3.  显示你的OPcache配置;Show your OPcache configuration
php artisan opcache:config
#4. 显示OPcache状态;Show OPcache status
php artisan opcache:status

十四、optimize

#1. 删除缓存的引导文件;Remove the cached bootstrap files
php artisan optimize:clear

十五、package

#1. 重新构建缓存的包清单;Rebuild the cached package manifest
php artisan package:discover

十六、passport

#1. 创建用于发出访问令牌的客户端;Create a client for issuing access tokens
php artisan passport:client
#2.  哈希客户端表中所有现有的秘钥;Hash all of the existing secrets in the clients table
php artisan passport:hash
#3. 运行准备使用Passport所需的命令;Run the commands necessary to prepare Passport for use
php artisan passport:install
#4. 为API身份验证创建加密密钥;Create the encryption keys for API authentication
php artisan passport:keys
#5. 清除已撤销和/或过期的令牌和认证代码;Purge revoked and / or expired tokens and authentication codes
php artisan passport:purge

十七、queue

#1. 为批数据库表创建迁移;Create a migration for the batches database table
php artisan queue:batches-table
#2. 从指定队列中删除所有作业;Delete all of the jobs from the specified queue
php artisan queue:clear
#3. 列出所有失败的队列作业;List all of the failed queue jobs
php artisan queue:failed
#4. 为失败的队列作业数据库表创建迁移;Create a migration for the failed queue jobs database table
php artisan queue:failed-table
#5. 清除所有失败的队列作业;Flush all of the failed queue jobs
php artisan queue:flush
#6. 删除失败的队列作业;Delete a failed queue job
php artisan queue:forget
#7. 监听给定队列;Listen to a given queue
php artisan queue:listen
#8. 从批处理数据库中删除过时的条目;Prune stale entries from the batches database
php artisan queue:prune-batches
#9. 在完成当前任务后重新启动队列辅助进程;Restart queue worker daemons after their current job
php artisan queue:restart
#10.重试失败的队列作业;Retry a failed queue job
php artisan queue:retry
#11. 批量重试失败的作业;Retry the failed jobs for a batch
php artisan queue:retry-batch
#12. 为队列作业数据库表创建迁移;Create a migration for the queue jobs database table
php artisan queue:table
#13. 作为守护进程开始处理队列上的作业;Start processing jobs on the queue as a daemo
php artisan queue:work

十八、route

#1. 创建路由缓存文件,用于更快地注册路由;Create a route cache file for faster route registration
php artisan route:cache
#2. 清除路由缓存文件;Remove the route cache file
php artisan route:clear
#3. 列出所有已注册的路由;List all registered routes
php artisan route:list

十九、schedule

#1. 列出定时命令;List the scheduled commands
php artisan schedule:list
#2. 执行定时命令;Run the scheduled commands
php artisan schedule:run
#3. 执行一条定时命令;Run a scheduled command
php artisan schedule:test
#4. 启动schedule worker;Start the schedule worker
php artisan schedule:work

二十、schema

#1. Dump the given database schema
php artisan schema:dump

二十一、seeder

#1.  清除seeder数据 Clear seeder data
php artisan seeder:clear

二十二、sentry

#1. 发布哨兵配置;Publishes the Sentry Config
php artisan sentry:publish
#2. 生成一个测试事件并将其发送给哨兵;Generate a test event and send it to Sentry
php artisan sentry:test

二十三、session

#1. 为会话数据库表创建迁移;Create a migration for the session database table
php artisan session:table

二十四、storage

#1. 为应用程序创建链接;Create the symbolic links configured for the application
php artisan storage:link

二十五、stub

#1. 发布可自定义的所有存根;Publish all stubs that are available for customization
php artisan stub:publish

二十六、translation

#1. 移除未使用的翻译;Remove unused translation
php artisan translation:remove-unused
#2. 同步翻译;Sync translation
php artisan translation:sync

二十七、vendor

#1. 从供应商包中发布任何可发布的assets;Publish any publishable assets from vendor packages
php artisan vendor:publish

二十八、view

#1. 编译所有应用程序的Blade模板;Compile all of the application's Blade templates
php artisan view:cache
#2. 清除所有已编译的视图文件;Clear all compiled view files
php artisan view:clear

本文为joshua317原创文章,转载请注明:转载自joshua317博客 https://www.joshua317.com/article/3

laravel artisan命令汇总相关推荐

  1. php laravel 调试,php – Xdebug laravel artisan命令

    我经常使用xdebug来调试应用程序,我已经构建了一个laravel应用程序,它可以上传一个csv,将数据插入到数据库中,并将id输入到作业队列中. 我写了一个工匠命令,通过cron运行,然后对这些数 ...

  2. laravel artisan命令大全

    1.选项: 命令 中文 -h, --help 显示给定命令的帮助. 当没有给出命令时显示列表命令的帮助 -q, --quiet 不输出任何消息 -v, --version 显示此应用程序版本 --an ...

  3. php artisan 计划任务,Laravel artisan命令及任务调度

    Artisan 是 Laravel 自带的命令行接口名称,它为我们在开发过程中提供了很多有用的命令.除了Artisan提供的系统命令之外,还可以构建自己的命令用于任务调度 1.查看及使用 php ar ...

  4. Laravel artisan命令

    1.应用场景 主要用于使用laravel自带的artisan命令可快速开发程序. 2.学习/操作 环境 Windows10 64位 专业版 laravel 5.8 / 5.7 phpstudy v8. ...

  5. laravel artisan 命令错误

     Unable to detect application namespace. 一般出现这种报错的时候 大部分都是因为composer.json里面存在某些字段错误 可能是某个逗号忘了删除导致的,可 ...

  6. artisan命令大全

    Laravel php artisan 自动生成Model+Migrate+Controller 命令大全 php artisan 命令是Laravel框架自带的命令,方便用户快速创建.查看对应的模块 ...

  7. php artisan命令表,php artisan 命令列表

    php  artisan 命令列表 命令获取 上面的翻译内容 命令说明备注 php artisan make:resource ?创建api返回格式化资源>=5.4版本可用 php artisa ...

  8. 关于laravel 框架运行数据库迁移文件的一个小坑以及常用php artisan命令

    小白我因为最近开发的一系列项目都是用的laravel框架,所以为了方便有时候就会直接复制一份代码以此作为新项目的基础.可能因为"因为夜路走多了,所以掉坑里了">>> ...

  9. laravel artisan 后台运行_3分钟短文:Laravel用户自定义命令行简明教程

    引言 完成一个功能需求,有时候并不需要一个界面UI,比如定时任务,后台任务, 对于这类任务往往比较耗时,在一个web页面生命周期内,要拖的很久.这时候我们 需要将其放在后台交给操作系统执行. 本期说一 ...

最新文章

  1. 变量声明和定义的区别
  2. Android配置build.gradle解锁更高逼格玩法(多版本共存、分服务器打包等)
  3. c++ new一个结构体_C语言结构体,又一个纸老虎,纯干货讲解(附代码)
  4. 2022年 1月 windows 新型勒索病毒 360Crypt将全部文件后缀改为.360 2022年最新传播勒索病毒
  5. 优化UITableViewCell高度计算的那些事
  6. fuel6.1搭建openstack
  7. java 开源客服系统_一个开源的智能客服系统
  8. Pytorch入门+实战系列五:Pytorch情感分类
  9. 边缘计算资源分配与任务调度优化综述
  10. 路演 - roadshow
  11. 【答学员问】有没有三十岁以上大龄转行的学员,我想跟他聊聊?
  12. 微带线特性阻抗计算公式_几种计算微带线特性阻抗的方法.pdf
  13. unity屏幕适配以及坐标点适配
  14. MOOC《深度学习基础》笔记(一)
  15. BufferedWriter的用法
  16. 【MapReduce】MapReduce读写MySQL数据
  17. 写游戏用python还是c好点_为什么多数游戏服务端是用 C++ 来写
  18. jquery图片加载失败
  19. 南京邮电大学C语言实验报告一
  20. 2020-10-24周总结

热门文章

  1. 计算机魔术教程文字,《Word字体魔术大师》说课稿
  2. mybatis学习10
  3. 密码学基础(二)单表---置换密码 凯撒密码 棋盘密码 乘法密码 仿射密码 多表---vigenere方阵
  4. 【写在七夕浪浪漫时刻】Go中遇到http code 206和302的获取数据的解决方案
  5. linu学习第二天:文件系统相关操作
  6. 解决一个assign问题,assign怎么用,assign有啥物理意义
  7. 2017-12-16 机器视觉表面缺陷检测综述
  8. Unity错误解决GetType().Name+“OnInspectorGUI must call ApplyRevertGUI to avoid unexpected behaviour.“
  9. 丰田将在所有销售店安装充电设备丰田章男社长“建立共享基础设施”
  10. 【机器人学】冗余七自由度机械臂的解析解逆解算法