会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
CanyingV
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
11
下一页
2022年3月3日
验证器-唯一验证,过滤软删数据
摘要: //添加 'name' => 'required|unique:icons,name,NULL,id,deleted_at,NULL', //NULL必须大写 //修改 'name' => 'required|unique:icons,name,' . $request->id . ',id,del
阅读全文
posted @ 2022-03-03 19:38 CanyingV
阅读(46)
评论(0)
推荐(0)
2021年12月24日
laravel-敏感词检测
摘要: //composer require lustre/php-dfa-sensitive // $wordData = [ // '察象蚂', // '拆迁灭', // '车牌隐', // '成人电', // '成人卡通' // ]; // $handle = SensitiveHelper::ini
阅读全文
posted @ 2021-12-24 16:38 CanyingV
阅读(283)
评论(0)
推荐(0)
2021年12月15日
laravel-查询执行的sql
摘要: $sql=Goods::select(['id','name']) ->where('id',1) // ->toRawSql() ->toSql();
阅读全文
posted @ 2021-12-15 10:16 CanyingV
阅读(213)
评论(0)
推荐(0)
2021年12月1日
手动添加获取器字段
摘要: $list=Scenics::select(['id','name'])->get(); $list->each->append('min_price');
阅读全文
posted @ 2021-12-01 08:38 CanyingV
阅读(23)
评论(0)
推荐(0)
2021年11月4日
正则匹配
摘要: $str = '姓名:{username},年龄:{age}'; preg_match_all("/[{](.*?)[}]/", $str, $res);//加?,使用非贪婪模式 return $this->success($res); { "status": "true", "code": 200
阅读全文
posted @ 2021-11-04 16:48 CanyingV
阅读(25)
评论(0)
推荐(0)
2021年9月30日
php-数字精确计算
摘要: bc函数库 https://www.php.net/manual/zh/ref.bc.php
阅读全文
posted @ 2021-09-30 14:30 CanyingV
阅读(36)
评论(0)
推荐(0)
2021年9月26日
laravel-事件
摘要: 1.App\Providers\EventServiceProvider文件中添加事件和监听器 protected $listen = [ Registered::class => [ SendEmailVerificationNotification::class, ], 'App\Events\
阅读全文
posted @ 2021-09-26 15:41 CanyingV
阅读(24)
评论(0)
推荐(0)
laravel-权限管理
摘要: 扩展包: spatie/laravel-permission 常用方法: public function postTest(Request $request) { //新增角色 // $role = Role::create(['name' => '组长3']); //新增权限 // $permis
阅读全文
posted @ 2021-09-26 10:34 CanyingV
阅读(416)
评论(0)
推荐(0)
2021年9月22日
验证器错误返回
摘要: use Illuminate\Contracts\Validation\Validator; public function failedValidation(Validator $validator) { $error_msg = $validator->errors()->first(); re
阅读全文
posted @ 2021-09-22 16:03 CanyingV
阅读(34)
评论(0)
推荐(0)
2021年9月18日
根据关联表字段查询
摘要: $lists = Orders::with(['goods:order_id,name']) ->whereHasIn('goods', function ($query) use ($goodsName) { if ($goodsName) { $query->where('name', 'lik
阅读全文
posted @ 2021-09-18 17:02 CanyingV
阅读(57)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
11
下一页
公告