ndirect modification of overloaded property App\\Models\\::$get_feed_info has no effect

运行程序报错:

"message": "Indirect modification of overloaded property App\\Models\\Duolaimei\\UserDynamic::$get_feed_info has no effect",
    "exception": "ErrorException",
    "file": "/Users/dutiantian/work/doubao/app/Http/Controllers/PostController.php",
    "line": 84,

 

无法中直接给一个不存在的对象赋值

 

解决方法:

$val->get_feed_info = (object)[];    //先定义空驻足对象
$val->get_feed_info->feed_type = $val->feed_type;  //再向其存在的空对象中追加数据

你可能感兴趣的:(解决方案)