The issue seems to be with the naming convention used for the relationship between the Blog and Post models. By default, Laravel assumes that the foreign key for a hasMany relationship is the singular form of the related model's name followed by _id. In this case, Laravel is incorrectly assuming that the foreign key for the hasMany relationship in the Blog model is blogs_id.
To fix this issue, you can explicitly specify the foreign key in the hasMany relationship in the Blog model. Update the posts method in the Blog model as follows:
public function posts(): HasMany
{
return $this->hasMany(\App\Models\Post::class, 'blog_id');
}
By specifying 'blog_id' as the second argument to the hasMany method, you are telling Laravel to use blog_id as the foreign key instead of the default blogs_id.
After making this change, Nova should generate the correct MySQL query without the non-existent blogs_id field.