laravel
wsy321123
这个作者很懒,什么都没留下…
展开
-
Call to a member function diffForHumans() on string 错误
laravel 8.x 时间字段 调用 diffForHumans() 报 Call to a member function diffForHumans() on string 错误示例代码:xxx.blade.php 页面调用{{ $product->end_at->diffForHumans(now()) }}解决方法1:{{ \Carbon\Carbon::parse($product->end_at)->diffForHumans(now()) }}解决方法原创 2021-06-01 10:47:32 · 427 阅读 · 1 评论 -
webSocket 与现有mvc框架(ThinkPHP Yii laravel等)整合
使用webSocket 与现有mvc框架(ThinkPHP Yii laravel等)整合, 现有mvc框架项目与Swoole 独立部署互不干扰。具体实现步骤1、网站页面建立与webSocket连接,2、页面发起连接时,将对应连接的client_id发给网站页面3、网站页面收到client_id后触发一个ajax请求将client_id发到mvc后端4、mvc后端收到client_id后将client_id与当前uid(用户id或者客户端唯一标识)绑定,保存到redis或数据库。如果想通过接收原创 2021-05-30 01:33:07 · 169 阅读 · 1 评论 -
Target class [wechat.mini_program] does not exist.
Target class [wechat.mini_program] does not exist.环境:laravel 8. * php 8安装 EasyWeChat 后 再tinker执行:\EasyWeChat::miniProgram();报:Illuminate\Contracts\Container\BindingResolutionException with message ‘Target class [wechat.mini_program] does not exist.’ 错原创 2021-04-09 10:52:45 · 879 阅读 · 0 评论 -
部署阿里云 发送邮件 报错
部署阿里云 发送邮件 报 Connection could not be established with host smtp.163.com :stream_socket_client(): unable to connect to tcp://smtp.163.com:25使用 465 加密端口使用加密验证: ssl这里使用的是 laravel 框架修改这两个参数就可以了MAIL_PORT=465MAIL_ENCRYPTION=ssl...原创 2021-03-26 13:26:37 · 1011 阅读 · 1 评论 -
laravel 8.x 使用 seeders 报 Call to undefined method App\Models\XXX::factory()
解决方法 :安装 composer require laravel/legacy-factories在App\Models 添加 use HasFactory;<?phpnamespace App\Models;use Illuminate\Database\Eloquent\Factories\HasFactory;use Illuminate\Foundation\Auth\User as Authenticatable;use Illuminate\Notifications原创 2021-01-27 14:31:44 · 1227 阅读 · 0 评论