当前位置:网站首页>Laravel+ pagoda planning task
Laravel+ pagoda planning task
2022-06-22 21:20:00 【Fragrant orange and treasure orange】
Execute locally first php artisan make:command job
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class job extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:name';// Generated task name
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()// Tasks to perform
{
DB::table('home')->where('id',1)->increment('num',1);
}
}
<?php
namespace App\Console;
use App\Console\Commands\job;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command(job::class)->everyMinute();// Call the executed task
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
Upload the project to the pagoda
Fill in the planned task

边栏推荐
- 【206. 反转链表】
- Résolu: peut - on avoir plus d'une colonne auto - incrémentale dans un tableau
- Golang learning notes - structure
- EasyClick 固定状态日志窗口
- 如何计算 R 中的基尼系数(附示例)
- Ultrafast transformers | redesign vit with res2net idea and dynamic kernel size, surpassing mobilevit
- Simulated 100 questions and simulated examination of hoisting machinery command examination in 2022
- R语言penguins数据集可视化
- 百家讲坛 黄帝内经(第一部)
- NBA季后赛对阵图
猜你喜欢

【206. 反转链表】

2022 chemical automation control instrument examination exercises and online simulation examination

One line of code binds swiftui view animation for a specific state
![[876. intermediate node of linked list]](/img/c8/463d150bc6c88cfb57e94795957b0e.png)
[876. intermediate node of linked list]

采用网络远程访问树莓派。

R语言penguins数据集可视化

一行代码为特定状态绑定SwiftUI视图动画

【CM11 链表分割】

R language Midwest dataset visualization

Resolved: can there be multiple auto incrementing columns in a table
随机推荐
启牛送的券商账户是安全的吗?启牛提供的券商账户是真的?
[876. intermediate node of linked list]
[redis]Redis6的主从复制
已解决:一個錶中可以有多個自增列嗎
云服务器中安装mysql(2022版)
Apple corefoundation source code
R 语言 UniversalBank.csv“ 数据分析
[redis]集群与常见错误
如何使用Feign构造多参数的请求
[redis]发布与订阅
【OR36 链表的回文结构】
Fluent system architecture
苹果GCD源代码
NBA季后赛对阵图
Feign常见问题总结
基于C语言开发工资管理系统 课程论文+源码及可执行exe文件
R language organdata dataset visualization
≥server2012R2系统,禁用系统自带的部分计划任务
Set up your own website (12)
2022化工自动化控制仪表考试练习题及在线模拟考试