Konstruktionsplan
2 months ago
492
18
Laravel

CollectionsTerror! ✨

Posted 2 months ago by Konstruktionsplan

Hallo

Illuminate\Database\Eloquent\Collection {#1261 ▼
  #items: array:3 [▼
    0 => App\Juice {#1048 ▶}
    1 => App\Juice {#1047 ▶}
    2 => Illuminate\Database\Eloquent\Collection {#1275 ▼
      #items: array:4 [▼
        0 => App\JuiceMix {#1276 ▶}
        1 => App\JuiceMix {#1277 ▶}
        2 => App\JuiceMix {#1278 ▶}
        3 => App\JuiceMix {#1279 ▶}
      ]
    }
  ]
}

Hello. I want it all to be an array of objects. Is that possible somehow? So for example

Illuminate\Database\Eloquent\Collection {#1261 ▼
  #items: array:3 [▼
    0 => App\Juice {#1048 ▶}
    1 => App\Juice {#1047 ▶}
    2 => App\JuiceMix {#1276 ▶}

Please sign in or create an account to participate in this conversation.