当前位置:网站首页>Laravel5.1 下的计划任务
Laravel5.1 下的计划任务
2022-07-21 05:07:00 【MountainYanYL】
在聊laravel下的计划任务之前,先和大家聊聊 php artisan make 命令
make:console //控制台下的命令
make:command // 命令
make:event //事件
make:job //任务队列
make:listener //监听者
make:model //Model 类
make:policy //政策
make:provider //内容提供者
make:request //请求
make:test //测试
make:migration //数据迁移
make:seeder //数据填充
make:controller //控制器
make:middleware //中间件
在控制台下创建一个新命令 make:console
php artisan make:console DemoTest
上述的命令会在app/Console/Commands/DemoTest.php
命令生成以后,需要填写该类的signature和description属性,这两个属性在调用list显示命令的时候会被用到。
handle方法在命令执行时被调用,你可以将所有命令逻辑都放在这个方法里面
逻辑写完之后需在Kernel.php 下执行脚本的方式
protected $commands = [
Commands\DemoTest::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command("$signural")->hourly();
}
边栏推荐
- 【好文记录】嵌入式框架Zorb Framework搭建过程
- ThinkPHP6 学习心得
- 解决safari浏览器拦截window.open
- There are multiple heroes that share the same tag within a subtree
- Hot update in development mode to speed up the code update of development environment
- 增删改查~
- 图片懒加载
- Object. prototype. toString. The principle of call()
- 2020 Changzhou programming expert real problem and solution
- Difference between controlled and uncontrolled components
猜你喜欢
MySQL导入导出&视图&索引&执行计划
Recommander un éditeur de markdown facile à utiliser Mark Text
[C language] 0.5 times the speed to explain the interesting C language playing methods of the century war
Crud of MySQL
Flutter报错总结:There are multiple heroes that share the same tag within a subtree.
Comsol热传导方法求解迷宫问题(路径规划)
移动安全入门指南
计算传热学基础
Visual studio third party library addition -- eigen
利用vscode插件 coderunner 编译运行 typescript,当输出有中文的时候,出现乱码
随机推荐
1.vite初识、vite搭建项目
JS将16进制颜色转为rgba格式
OpenFOAM中的多孔介质
Wechat applet request:fail -2:net:: err_ FAILED
MySQL account management Database building and four engines
[c language] light rises in the dull days, the initial stage and the final battle
JS dynamically realizes the countdown function
图片懒加载
Uniapp customized navigation bar buttons and button click events
10. [file opening format and its determination of whether to open]
[HTTP cache]
Crud of MySQL
Add, delete, modify and check~
window. history. back(); The problem that layer cannot be closed after returning
Visual studio third party library addition -- eigen
sonarLint使用、介绍
Object.prototype.toString.call()的原理
php截取得到指定字符串之前与之前后的内容
Custom MVC framework implementation
Usage and introduction of sonarlint