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.
- Host: GitHub
- URL: https://github.com/codewithdennis/filament-nested-dot-bug
- Owner: CodeWithDennis
- Created: 2025-09-29T12:38:46.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-09-29T12:38:55.000Z (6 months ago)
- Last Synced: 2025-10-24T15:43:46.436Z (5 months ago)
- Language: Blade
- Size: 1.7 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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);
});
```