filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.09k stars 2.83k forks source link

RepeatableEntry on HasMany Relations not working #14372

Open KamranBiglari opened 3 days ago

KamranBiglari commented 3 days ago

Package

filament/filament

Package Version

latest

Laravel Version

v3.2.115

Livewire Version

No response

PHP Version

PHP 8.3

Problem description

I have SalesOrderLines which is a HasMany relation. The RepeatableEntry doesn't show the data in infolist.

dd($infolist->record->SalesOrderLines()->get()); // I can confirm that there are items in it and it's not empty

public static function infolist(Infolist $infolist): Infolist
    {
        // dd($infolist->record->SalesOrderLines()->get());
        return $infolist
            ->schema([
                ...self::getSalesOrderInfoListSchema($infolist),
                \Filament\Infolists\Components\RepeatableEntry::make('SalesOrderLines')
                    ->columns(5)
                    ->schema([
                        Infolists\Components\TextEntry::make('ItemCode')
                            ->label(__('panel.itemcode'))
                            ->inlineLabel(),
                        Infolists\Components\TextEntry::make('ItemDescription')
                            ->label(__('panel.itemdescription'))
                            ->inlineLabel(),
                        Infolists\Components\TextEntry::make('Quantity')
                            ->label(__('panel.quantity'))
                            ->inlineLabel(),
                        Infolists\Components\TextEntry::make('AmountDC')
                            ->label(__('panel.amountdc'))
                            ->inlineLabel(),
                        Infolists\Components\TextEntry::make('AmountFC')
                            ->label(__('panel.amountfc'))
                            ->inlineLabel(),
                    ]),
            ]);
    }

Expected behavior

Show all related data

Steps to reproduce

public function SalesOrderLines():  HasMany
    {
        return $this->hasMany(SalesOrderLine::class, 'OrderID', 'OrderID');
    }

Reproduction repository (issue will be closed if this is not valid)

https://github.com/KamranBiglari/mattech-hub3

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

leandrocfe commented 1 day ago

@KamranBiglari the repo is not available..

KamranBiglari commented 2 hours ago

@KamranBiglari the repo is not available..

Sorry, but it's not public!