nova-inline-relationship
nova-inline-relationship copied to clipboard
Error Occurred when use HasOne Relation
This is the relation between Brand and Attachment Models
// brand has one attachment
public function attachment()
{
return $this->hasOne(Attachment::class);
}
// attachment belongs to brand
public function brand()
{
return $this->belongsTo(Brand::class);
}
and this is the code in Brand Resource
HasOne::make('attachment')->inline(),
finally this is the error
@phpMuhammed The issue appears to be that you nee the HasOne
field in the Attachment resource, and the BelongsTo
field in the Brand resource. Try switching those and let me know if it fixes the issue.