Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Occurred when use HasOne Relation #51

Open
phpMuhammed opened this issue Feb 3, 2020 · 1 comment
Open

Error Occurred when use HasOne Relation #51

phpMuhammed opened this issue Feb 3, 2020 · 1 comment

Comments

@phpMuhammed
Copy link

phpMuhammed commented Feb 3, 2020

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

errorBrand

@brandonferens
Copy link
Member

brandonferens commented Feb 3, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants