chris-ware / nova-breadcrumbs

Breadcrumbs for Laravel Nova
152 stars 44 forks source link

Fix display on sorted resource index #111

Closed stryaponoff closed 3 years ago

stryaponoff commented 3 years ago

All works as expected on the resource pages until I sort the table by any sortable resource field. If I use sorting then I can see HTTP errors in browser console and only Home is displayed in breadcrumbs.

I noticed that it's because I have not empty query but it not contains viaResource and viaResourceId fields so I attach a suggestion how to solve this.

chris-ware commented 3 years ago

@stryaponoff I've implemented this slightly differently, but with most of the same logic provided. Thanks for pointing out the issue that even if query strings exist, it would fail, due to the checks for viaResource and viaResourceId.