之前还在说用了CF后,连垃圾评论都没了。
结果,一通电话过来。说如果你再用CF,把IP指在国外,就直接取消备案了。然而CF国内版又用不起,也看了一下怎么个国内加速,还是有点繁琐,所以还是先暂时禁用吧。
其实用CF做代理的时候 ,还能享受直接https,现在我还得自己再配https。真烦人
而且,又开始收到垃圾评论了。
忍忍吧
膘叔的简单人生
之前还在说用了CF后,连垃圾评论都没了。
在尝试使用 envoy 尝试自动部署的时候,遇到了问题,即:如果我要自己创建一个新的域名,那只能上线去执行 lnmp vhost add 的命令。
sudo /usr/bin/expect<<EOF
spawn lnmp vhost add
expect {
"Please enter domain" {send "{{$host}}\n";exp_continue}
"Enter more domain name" {send "\n";exp_continue}
"Please enter the directory" {send "\n";exp_continue}
"Allow Rewrite rule" {send "y\n";exp_continue}
"Default rewrite" {send "laravel\n";exp_continue}
"Enable PHP Pathinfo" {send "\n";exp_continue}
"Allow access log" {send "\n";exp_continue}
"Enable IPv6" {send "\n";exp_continue}
"Enter your choice " {send "\n";exp_continue}
"Add SSL Certificate" {send "\n";exp_continue}
"Press any key to start" {send "\r"; exp_continue}
}
expect eof
EOF
@task('lnmp' ,['on'=>'dev'])
@if($force)
sudo rm -rf /usr/local/nginx/conf/vhost/{{$host}}.conf
sudo rm -rf /home/wwwroot/{{$host}}
@endif
sudo /usr/bin/expect<<EOF
spawn lnmp vhost add
expect {
"Please enter domain" {send "{{$host}}\n";exp_continue}
"Enter more domain name" {send "\n";exp_continue}
"Please enter the directory" {send "\n";exp_continue}
"Allow Rewrite rule" {send "y\n";exp_continue}
"Default rewrite" {send "laravel\n";exp_continue}
"Enable PHP Pathinfo" {send "\n";exp_continue}
"Allow access log" {send "\n";exp_continue}
"Enable IPv6" {send "\n";exp_continue}
"Enter your choice " {send "\n";exp_continue}
"Add SSL Certificate" {send "\n";exp_continue}
"Press any key to start" {send "\r";}
}
expect eof
EOF
ls -lah /home/wwwroot/
@endtask
这样就 OK 了
之前本来有准备写内容,但不知道 怎么回事编辑器加载不出来直接报错,于是就放弃了。
在使用 phpstorm/webstorm 进行前端开发的时候,一般会设置 alias,比如@,但在 IDEA 中,如果项目是 vite/vuejs 的时候 ,无法识别路径。
const path = require("path");
module.exports = {
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js'),
'~': path.resolve(__dirname, 'resources')
}
}
}
解决 tailwindCss 与 elementUI 最简单办法就是
plugin(function ({addBase}) {
addBase({
".el-button": {
"background-color": "var(--el-button-bg-color,val(--el-color-white))"
}
})
}),
如题,真没想到barryvdh/laravel-ide-helper还在更新。毕竟现在phpStorm已经功能这么强大了,我想它应该是没有用了吧!结果在看到LaravelQuery的插件时,提到了它,同时提到的还有LaravelIdea。毕竟 LaravelIdea是要钱的。还挺贵。所以又composer require了一下barryvdh/laravel-ide-helper。
function scopeIsActive($query ){
$query->where('status','=','active');
}
在用的时候 Model::query()->isActive()->get(); 写到 isActive()后,后面的方法都认不出来。/**
* @method static \Illuminate\Database\Eloquent\Builder|ModelName isActive()
*/
纯备份,长时间不用的时候 直接就忘了
class Shop{
/**
* 员工
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function staffs()
{
// 1、目标类 UnionUser,
// 2、中间表的表名 pivot: union_user_store,
// 3、中间表对应当前表的字段 :shopcode ,
// 4、中间表对应目标类的字段 usercode
// 当关联不是ID时,需要有5、6参数
// 5、当前类对应 3的字段 (code -> 3:shopcode)
// 6、目标类对应4的字段 (usercode -> 4:usercode )
return $this->belongsToMany(UnionUser::class, UnionUserStore::getTable(), 'shopcode', 'usercode', 'code', UnionUser::USERCODE);
}
}
一般而言,elementUI的prop+rules可以用来对字段进行校验。大多数情况下感觉都没什么问题,毕竟官方的例子摆在那里。element-plus的例子没有的,element-ui2的例子也比较全。
1、参考官方文档,将一些不用的 filters ,等去掉