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

后端 未结 6 1310
野性不改
野性不改 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:35

    You might need to change your object to an array first. I dont know what export does, but I assume its expecting an array.

    You can either use

    get_object_vars()

    Or if its a simple object, you can just typecast it.

    $arr = (array) $Object;

提交回复
热议问题