Skip to content

Laravel 9.x Eloquent method with return error Call to undefined relationship [customer] on model \App\Models\SaleOrderGeneral #45493

Discussion options

You must be logged in to vote

is a typo

wihTrashed => withTrashed

/**
     * Get the customer that owns the SaleOrderGeneral
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function customer(): BelongsTo
    {
        return $this->belongsTo(Customer::class)->wihtTrashed();
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zulfikar-ditya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant