当前位置:网站首页>Laravel随笔记录
Laravel随笔记录
2022-08-02 03:26:00 【陌潇】
Laravel 点滴记录
临时取消时间戳自动维护:
可在当前控制器使用,如更新数据状态、或更新阅读量。
// $blong 当前模型表
$blong->timestamps = false;
- 随时记录日志
使用 info() 可随时记录日志,记录在 \storage\logs\laravel.log 可查看数据
info('开始发送');
- 数据验证
$validator = Validator::make($request->all(),[
'title' => 'required|max:8',
'body' => 'required',
],[
'title.required' => '标题必须填写',
'title.required' => '标题不能超过8个字符',
'body.required' => '内容不能为空',
])
数据库队列消息
1,生成任务类
默认情况下,应用程序的所有可排队任务都存储在 app/Jobs 目录下。如果 app/Jobs 目录不存在,则会在运行 make:job Artisan 命令时将创建它。你可以使用 Artisan CLI 生成一个新的队列任务:php artisan make:job ProcessPodcast2,使用:
public function aaa() { ProcessPodcast::dispatch(); echo '我是成功的'; }2,要使用 database 队列驱动程序,你需要一个数据库表来保存任务。要生成创建此表的迁移,请运行 queue:table Artisan 命令。一旦迁移已经创建,你可以使用 migrate 命令迁移你的数据库:
php artisan queue:table php artisan migrate3,运行队列
php artisan queue:work
边栏推荐
- hackmyvm: kitty walkthrough
- Alfa: 1 vulnhub walkthrough
- ES6 three-dot operator, array method, string extension method
- hackmyvm-hopper walkthrough
- Stable and easy-to-use short connection generation platform, supporting API batch generation
- hackmyvm: again walkthrough
- (1) introduction to Thinkphp6, installation view, template rendering, variable assignment
- Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
- 库存现金、现金管理制度、现金的账务处理、银行存款、银行存款的账务处理、银行存款的核对
- hackmyvm: may walkthrough
猜你喜欢

Google Hacking

How to determine the direction based on two coordinate points on the map

CTF entry md5

How to log in to Alibaba Cloud server using the admin account

Praying: 1 vulnhub walkthrough

广告电商「私域打工人」职业前景:你离月薪6万,还差多远?

MOMENTUM: 2 vulnhub walkthrough

会计凭证概述、原始凭证、原始凭证的种类、原始凭证的基本内容、原始凭证的填制要求、原始凭证的审核

动力:2 vulnhub预排

命令执行漏洞
随机推荐
Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
Scrapy爬虫遇见重定向301/302问题解决方法
hackmyvm: kitty walkthrough
借贷记账法下的账户结构、借贷记账法的记账规则、借贷记账法下的账户对应关系与会计分录
(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符
hackmyvm: kitty walkthrough
解密:链动2+1的商业模式
Basic use of v-on, parameter passing, modifiers
Alibaba Cloud MySQL 5.7 installation and some major problems (total)
A code audit notes (CVE - 2018-12613 phpmyadmin file contains loopholes)
链动2+1模式开发系统
链动2+1无限循环系统,2022年起盘成功率超高的模式
v-bind usage: class dynamic binding object array style style and function method
SQL注入(7)
The first time to tear the code by hand, how to solve the problem of full arrangement
[sebastian/diff] A historical change extension library for comparing two texts
hackmyvm: controller walkthrough
命令执行漏洞
Praying: 1 vulnhub walkthrough
CTF入门笔记之SQL注入