An open API service indexing awesome lists of open source software.

https://github.com/codewithdennis/filament-nested-dot-bug

Two-level (nested) relation fields (e.g. province.country.name) are not resolving, while single-level relations (e.g. province.name) work correctly.
https://github.com/codewithdennis/filament-nested-dot-bug

Last synced: 20 days ago
JSON representation

Two-level (nested) relation fields (e.g. province.country.name) are not resolving, while single-level relations (e.g. province.name) work correctly.

Awesome Lists containing this project

README

          

### Installation

**Installation**

```bash
git clone git@github.com:CodeWithDennis/filament-nested-dot-bug.git
cd filament-nested-dot-bug/
composer install
npm install
npm run build
php artisan filament:upgrade
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan db:seed
```

**Run the tests to see the 2nd example fail.**

```
php artisan test
```

### Issue

Two-level (nested) relation fields (e.g. province.country.name) are not resolving, while single-level relations (e.g. province.name) work correctly.

```
it('can sort by `province.country.name` column', function (): void {
$records = Location::factory(3)->create();

livewire(ListLocations::class)
->loadTable()
->sortTable('province.country.name')
->assertCanSeeTableRecords($records->sortBy('province.country.name'), inOrder: true)
->sortTable('province.country.name', 'desc')
->assertCanSeeTableRecords($records->sortByDesc('province.country.name'), inOrder: true);
});
```