-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 8
- Nova Version: 3.31
- PHP Version: 8
- Database Driver & Version: MySQL
Description:
If you add a Ray debug to the relationship method, the API request is returning blank models as shown below when accessing a Post resource.
class Post extends Model {
public function tags() {
ray(request()->url(), $this)->label(__FUNCTION__);
return $this->morphToMany(Tag::class, 'taggable');
}
}In my example this Post has 3 Tags, and it seem to be outputting 3 blank Post models in the debug output.
This is causing me problems and doesn't seem right.
Why is this happening and is there a way to prevent it?
Detailed steps to reproduce the issue on a fresh Nova installation:
1.) Follow this structure for creating Laravel & Nova Models:
https://laravel.com/docs/8.x/eloquent-relationships#many-to-many-polymorphic-relations
2.) Create / Seed the Tags and Posts + Videos
3.) Navigate to a Post
Metadata
Metadata
Assignees
Labels
No labels
