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.98k stars 2.93k forks source link

RepeatableEntry on HasMany Relations not working #14372

Open KamranBiglari opened 1 month ago

KamranBiglari commented 1 month 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 month ago

@KamranBiglari the repo is not available..

KamranBiglari commented 1 month ago

@KamranBiglari the repo is not available..

Sorry, but it's not public!

leandrocfe commented 1 month ago

I don’t think this is a Filament issue. There may be something wrong with your project. Please provide a minimal repository to reproduce the problem.