Skip to content

Unable to load correct Nova Resource with nested resources with same class names #6584

@gcg

Description

@gcg
  • Laravel Version: v11.33.2
  • Nova Version: v4.35.4
  • PHP Version: 8.3.13

Description:

Lets say you have a class with same name as resources in different sub resource namespace/folders (eg: 'App\Nova\Resources\XXX\LogandApp\Nova\Resources\YYY\Log`)

Even though I am explicly setting 3rd param on HasMany with both class

      HasMany::make('Logs', 'logs', Log::class),

and i tried with string

      HasMany::make('Logs', 'logs', 'App\Nova\XXX\Log'),

However, even though the data that log loaded is for the correct eloquent model (since eloquent relationships are not effected the same way nova resources are), the resource is not right so I can only see the matching fields between 2 resources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions