FilamentF
Filament3w ago
Vp

nested repeater n+1 query

I have model like "booking", "booking_item", and "booking_item_detail", so I try to create a repeater data while creating new booking

Repeater::make('items')
    ->relationship()
    ->schema([
        Repeater::make('details')->relationship(),
    ]),


Relationships are HasMany
// Booking.php
public function items(): HasMany
{
    return $this->hasMany(BookingItem::class);
}

// BookingItem.php
public function details(): HasMany
{
    return $this->hasMany(BookingItemDetail::class);
}


How can I prevent n+1 query
Screenshot_2025-12-03_at_11.30.23.png
Was this page helpful?