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 ?