我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Laravel setPublishedAtAttribute错误

can someone help me with this error?

Indirect modification of overloaded property App\Article::$atributes has no effect

Here's the code:

public function setPublishedAtAttribute($date){
    $this->atributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date);
}  

I am trying to add clock to my published_at column...

Oh, I've fount the problem a few minutes after I've posted this question...

$this->attributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date);

I've missed one "t" letter in Attributes. :)

近期文章

  • 如何从数组php中获取值
  • Google云端服务帐户和“未经授权的客户端或请求范围”
  • 将内容插入WooCommerce循环
  • PHP如果SQL计数的条件语句
  • WooCommerce分页与自定义循环
  • Cakephp为整个项目切换数据库连接
  • 如何根据搜索提取每个用户的帖子
  • (PDO,PHP)使用预准备语句将多个数据从数组插入到数据库中
  • CodeIgniter链接到另一个页面/控制器
  • 使用Ajax加载更新数据不起作用
  • 来自具有缩进的对象/数组的PHP XML序列化(替换pear / XML_serializer)
  • yii1与url-manager分页
  • 显示聊天消息时出错
  • 将多个表连接在一起
  • 使用会话codeigniter时出错
  • 从sql [duplicate]中的表中检索前n个字母
  • 将参数$ argv从html表单传递给脚本
  • 如何在分隔符内分解子分隔符?
  • 在single.php wordpress上设置子类别
  • 无法在php中的excel中导出数据库信息的最后一行

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华