Answers for "laravel object of class illuminate\support\collection could not be converted to int"

PHP
0

Object of class Illuminate\Database\Eloquent\Builder could not be converted to string

Put "->first();" in the end of function call
Posted by: Guest on February-08-2021
0

object of class stdclass could not be converted to string php laravel

/*
$data is indeed an array, but it's made up of objects.

Convert its content to array before creating it*/
$data = array();
foreach ($results as $result) {
   $result->filed1 = 'some modification';
   $result->filed2 = 'some modification2';
   $data[] = (array)$result;  
   #or first convert it and then change its properties using 
   #an array syntax, it's up to you
}
Excel::create(....
Posted by: Guest on September-11-2021

Code answers related to "laravel object of class illuminate\support\collection could not be converted to int"

Browse Popular Code Answers by Language