I have already fixed this. but it still is rare to see.
Feb 4, 2025
6
Level 17
I think ive gotten the rarest laravel message ever
I was working on my space code (spaces are groups) and i dd the $allSpaces variable and got this.
good laugh laravel, good laugh.
public function navSpaces()
{
$primarySpaceId = $this->settings->primary_space;
$secondarySpaceId = $this->settings->secondary_space;
$spaces = $this->spaces();
$primarySpace = null;
$secondarySpace = null;
$otherSpaces = collect();
if ($primarySpaceId) {
$primarySpace = $spaces->where('id', $primarySpaceId)->first();
}
if ($secondarySpaceId) {
$secondarySpace = $spaces->where('id', $secondarySpaceId)->first();
}
$otherSpaces = $spaces->whereNotIn('id', [$primarySpaceId, $secondarySpaceId])->orderBy('created_at', 'desc');
// Combine in the desired order: primary, secondary, then latest
$allSpaces = collect();
if ($primarySpace) {
$allSpaces->push($primarySpace);
}
if ($secondarySpace) {
$allSpaces->push($secondarySpace);
}
$allSpaces = $allSpaces->concat($otherSpaces->take(5 - $allSpaces->count())); // Take enough to fill up to 5.
dd($allSpaces);
return $allSpaces->map(function ($space) use ($primarySpaceId, $secondarySpaceId) {
return [
'id' => $space->id,
'name' => $space->name,
'slug' => $space->slug(),
'thumbnail' => $space->thumbnail(),
'is_primary' => $space->id === $primarySpaceId,
'is_secondary' => $space->id === $secondarySpaceId, // Add is_secondary flag
];
});
}
Level 102
Its just what happens when you dd() without any data at all.
Try this
dd();
Its part of symfony/vardumper https://github.com/symfony/var-dumper/blob/7.2/Resources/functions/dump.php#L53
1 like
Please or to participate in this conversation.