liziyu 发布的文章

更新中间表记录

如果你需要在中间表中更新一条已存在的记录,可以使用 updateExistingPivot 。此方法接收中间表的外键与要更新的数据数组进行更新:

$user = App\Models\User::find(1);

$user->roles()->updateExistingPivot($roleId, $attributes);

一、安装redis扩展

进入php目录,以php7.4.21为例

$  cd /Applications/MAMP/bin/php/php7.4.21

1.在当前目录下载phpredis安装包

$  git clone https://github.com/nicolasff/phpredis.git

2.执行phpize命令,生成.configure可执行文件

$  cd phpredis
$  phpize

3.编译安装

$  ./configure --with-php-config=/Applications/MAMP/bin/php/php7.4.21/bin/php-config
$   make

4.这时phpredis/modules下会生成redis.so,把它复制到对应扩展目录下

5.复制redis.so到扩展目录

$  sudo cp -p modules/redis.so  /Applications/MAMP/bin/php/php7.4.21/lib/php/extensions/no-debug-non-zts-20190902/

然后把redis拓展加到php.ini里,这里非常注意坑,对应的位置在/Applications/MAMP/bin/php/php7.4.21/conf/php.ini 里增加:

//php.ini
...
extension=redis.so
...

二、最后安装redis(上面只是编译redis.so

$   brew install redis

三、启动redis如下(brew services start redis)

To have launchd start redis now and restart at login:
  brew services start redis
Or, if you don't want/need a background service you can just run:
  redis-server /usr/local/etc/redis.conf

四、设置redis在后台运行

$  sudo vim  /usr/local/etc/redis.conf

如下图,
redis.png
daemonize改为yes,表示需要后台开启服务器端。原来默认是no,然后ESC+:wq保存退出。

参考:https://www.it610.com/article/1288352079018008576.htm

php设计模式 http://www.imooc.com/learn/236
php异常,错误处理 http://www.imooc.com/learn/380

1.D2admin

开源地址:https://github.com/d2-projects/d2-admin
文档地址:https://d2.pub/zh/doc/d2-admin/
效果预览:https://d2.pub/d2-admin/preview/#/index
开源协议:MIT

2.vue-element-admin

开源地址:https://github.com/PanJiaChen/vue-element-admin
文档地址:https://panjiachen.github.io/vue-element-admin-site/zh/
效果预览:https://d2.pub/d2-admin/preview/#/index
开源协议:MIT

3.JEECG-BOOT

开源地址:https://github.com/zhangdaiscott/jeecg-boot
文档地址:https://panjiachen.github.io/vue-element-admin-site/zh/
效果预览:http://boot.jeecg.com/
开源协议:Apache-2.0 License

4.GIN-VUE-ADMIN

开源地址:https://github.com/flipped-aurora/gin-vue-admin
文档地址:https://www.gin-vue-admin.com/
效果预览:http://demo.gin-vue-admin.com/#/layout/dashboard
开源协议:Apache-2.0 License

5.vue-admin-beautiful

开源地址:https://github.com/chuzhixin/vue-admin-beautiful
文档地址:https://www.gin-vue-admin.com/
效果预览:http://beautiful.panm.cn/
开源协议:MPL-2.0 License

6.Dcat-admin

开源地址:https://github.com/jqhph/dcat-admin
文档地址:http://www.dcatadmin.com/
效果预览:http://103.39.211.179:8080/admin
开源协议:MIT License

7.RuoYi

开源地址:https://gitee.com/y_project/RuoYi
文档地址:https://doc.ruoyi.vip/
效果预览:https://vue.ruoyi.vip/index
开源协议:MIT License

8.renren-fast-vue

开源地址:https://gitee.com/renrenio/renren-fast-vue
文档地址:https://www.renren.io/guide
效果预览:http://demo.open.renren.io/renren-fast/#/home
开源协议:MIT License

9.ant-design-pro

开源地址:https://github.com/ant-design/ant-design-pro
文档地址:https://pro.ant.design/index-cn/
效果预览:https://pro.ant.design/
开源协议:MIT License

10.iview-admin

开源地址:https://github.com/iview/iview-admin
文档地址:https://lison16.github.io/iview-admin-doc/
效果预览:https://admin.iviewui.com/home
开源协议:MIT License

11.material-dashboard

开源地址:https://github.com/creativetimofficial/material-dashboard#demo
文档地址:https://demos.creative-tim.com/material-dashboard/docs/2.1/getting-started/introduction.html
效果预览:https://demos.creative-tim.com/material-dashboard/examples/dashboard.html
开源协议:MIT License

12.EAdmin

开源地址:https://github.com/suruibuas/eadmin
文档地址:http://doc.eadmin.com.cn/
效果预览:http://www.eadmin.com.cn/
开源协议:无

源地址:https://mp.weixin.qq.com/s/lGz4Cc5jqGAqqmaOteatvA