Antarax :
Dilip Hirapara :
try as below.
$adatok = DB::select('SELECT * FROM ingatlan');
$return = array();
foreach ($adatok as $adat) {
$adat->image = Storage::files($adat->id);
$return[] = $adat;
}
return $return;
as you're using array_push();
it is inserting the value of Storage::files($adat->id)
after the $adatok
object which you're getting in select query.
What solution does is all records fetched from the table. for each collection, I've added an image element with value and store in an array. Finally, you'll have an array with images.