laravel/nova-issues

`HasMany` relationship field results in undefined method exception

benpdavison opened this issue · 2 comments

  • Laravel Version: 9.52.16
  • Nova Version: 4.34.2
  • PHP Version: 8.1.28
  • Database Driver & Version: Mysql 8.0
  • Operating System and Version: Sonoma 14.4.1
  • Browser type and version: Chrome 124.0.6367.210
  • Reproduction Repository: https://github.com/###/###

Description:

After upgrading to 4.34 HasMany relationship now results in
Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getForeignKey() I assume from the new ResolvesReverseRelation trait.

Detailed steps to reproduce the issue on a fresh Nova installation:

Add a HasMany field to a resource, and the error occurs when I load up the detail page of the resource with the relation.
This field was previously working in 4.33.

We have multiple feature and dusk test covering this usage. Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

Hi @crynobone, apologies I cannot replicate on initial setup of a fresh project. I will close for now and raise again if I find an issue. Thanks.