2 months ago

Undefined property: HasMany::$id

Posted 2 months ago by timtom


I got a problem with foreign relations and eloquent, i would like to retrieve id from this :


And i got this error :

ErrorException: Undefined property: Illuminate\Database\Eloquent\Relations\HasMany::$id

It is strange because this is working for example : $invoice->payments()->sum('amount')

Someone already got this error ?

Please sign in or create an account to participate in this conversation.