当前位置:网站首页>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 ProcessPodcast
2,使用:
public function aaa() { ProcessPodcast::dispatch(); echo '我是成功的'; }
2,要使用 database 队列驱动程序,你需要一个数据库表来保存任务。要生成创建此表的迁移,请运行 queue:table Artisan 命令。一旦迁移已经创建,你可以使用 migrate 命令迁移你的数据库:
php artisan queue:table php artisan migrate
3,运行队列
php artisan queue:work
边栏推荐
- uniapp | Problems with the use of the official map component
- How to determine the direction based on two coordinate points on the map
- Basic use of v-on, parameter passing, modifiers
- pytorch:保存和加载模型
- DNS详解
- (1) the print () function, escape character, binary and character encoding, variables, data type, the input () function, operator
- 管理会计(对内)指引、管理会计要素及其具体内容(可能考,考前记一下,推荐记一下四个大点即可)、
- 链动2+1无限循环系统,2022年起盘成功率超高的模式
- [campo/random-user-agent] Randomly fake your User-Agent
- Masashi: 1 vulnhub walkthrough
猜你喜欢
重点考:从债劵的角度来看交易性金融资产
12. What is JS
PHP Foundation March Press Announcement Released
(5) Modules and packages, encoding formats, file operations, directory operations
hackmyvm: kitty walkthrough
(4) 函数、Bug、类与对象、封装、继承、多态、拷贝
hackmyvm-bunny预排
成本会计的概念、产品成本核算的要求、产品成本核算的对象与成本项目、产品成本的归集和分配(可能考判断)、产品成本计算方法 (三种:产品的品种(品种法),批次(分批法),步骤(分步法))
利用cookie获取admin权限 CTF基础题
DarkHole: 2 vulnhub walkthrough
随机推荐
2. PHP variables, output, EOF, conditional statements
Eric靶机渗透测试通关全教程
Stable and easy-to-use short connection generation platform, supporting API batch generation
CTF入门之php文件包含
Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
文件上传漏洞
Masashi: 1 vulnhub walkthrough
Shuriken: 1 vulnhub walkthrough
(3) 字符串
Mysql创建索引
(4) 函数、Bug、类与对象、封装、继承、多态、拷贝
Orasi: 1 vulnhub walkthrough
[symfony/finder] The best file manipulation library
file contains vulnerabilities
(7) superficial "crawlers" process (concept + practice)
PHP反序列化漏洞
17. JS conditional statements and loops, and data type conversion
(8) requests, os, sys, re, _thread
redis未授权访问(4-unacc)
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合