Skip to content

Commit cd51fd2

Browse files
author
Pantea Marius-ciclistu
committed
Override getKey on base Model for \Illuminate\Database\Eloquent\Collection::getDictionary
1 parent 24ff35b commit cd51fd2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Models/BaseModel.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@ public function getPrimaryKeyFilter(): array
202202
];
203203
}
204204

205+
/**
206+
* @inheritdoc
207+
*/
208+
public function getKey()
209+
{
210+
return $this->getPrimaryKeyIdentifierAttribute();
211+
}
212+
205213
/**
206214
* Overwrite this for sqlite and sqlsrv db drivers if needed
207215
* @throws \Throwable

0 commit comments

Comments
 (0)