Object of class stdClass could not be converted to string - laravel

后端 未结 6 1167
野性不改
野性不改 2021-02-18 17:04

I am following this documentation

to implement export to Excel in my laravel 4 project.

So am trying to generate excel file from array like this:



        
6条回答
  •  借酒劲吻你
    2021-02-18 17:19

    If you have a Collection of stdClass objects, you could try with this:

    $data = $data->map(function ($item){
                return get_object_vars($item);
            });
    

提交回复
热议问题