当前位置:网站首页>laravel+宝塔计划任务
laravel+宝塔计划任务
2022-06-22 19:26:00 【香橙战宝橙留香】
先在本地执行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';//生成的任务名称
/**
* 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()//要执行的任务
{
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();//调用执行的任务
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
将项目上传上传到宝塔
填写计划任务

边栏推荐
- Introduction of neural networks for Intelligent Computing (Hopfield network DHNN, CHNN)
- Raspberry pie environment settings
- Easydss problem and solution summary
- R 语言 wine 数据集可视化
- 智能計算之神經網絡(BP)介紹
- Nestjs integrates config module and Nacos to realize configuration unification
- Cryptography series: certificate format representation of PKI X.509
- Stochastic Adaptive Dynamics of a Simple Market as a Non-Stationary Multi-Armed Bandit Problem
- Scheduling with Testing
- A Dynamic Near-Optimal Algorithm for Online Linear Programming
猜你喜欢

How to consider the arrangement of complete knapsack

Introduction of Neural Network (BP) in Intelligent Computing

One picture decoding opencloudos community open day

Ribbon load balancing

MySQL Basics - functions
Code to Image Converter | 代码生成漂亮图片工具

Alibaba cloud video on demand playback error, console access code:4400

R语言penguins数据集可视化

智能计算之神经网络(BP)介绍

CVPR 2022 Oral | 视频文本预训练新SOTA,港大、腾讯ARC Lab推出基于多项选择题的借口任务
随机推荐
MYSQL 几个常用命令使用
[graduation season] step by step? Thinking about four years of University by an automation er
How to calculate the Gini coefficient in R (with examples)
Introduction of neural network (BP) in Intelligent Computing
扩展Ribbon支持Nacos权重的三种方式
底部菜单添加的链接无法跳转到二级页面的问题
Introduction of Neural Network (BP) in Intelligent Computing
Overview of common loss functions for in-depth learning: basic forms, principles and characteristics
89-oracle SQL写法与优化器缺陷一例
Implementation of UART with analog serial port
CVPR 2022 Oral | 视频文本预训练新SOTA,港大、腾讯ARC Lab推出基于多项选择题的借口任务
智能計算之神經網絡(BP)介紹
Is the brokerage account of qiniu delivery safe? Is the brokerage account provided by qiniu true?
78-生产系统不改代码解决SQL性能问题的几种方法
【已解决】--go_out: protoc-gen-go: Plugin failed with status code 1.
R 语言nutrient数据集的可视化
Precautions for Apollo use
用RNN & CNN进行情感分析 - PyTorch
阿里云视频点播播放出错,控制台访问出现code:4400
From perceptron to transformer, a brief history of deep learning