Skip to content

Commit 92f1089

Browse files
benargojenssegers
authored andcommitted
Add default property to getIdAttribute (#1098)
Since the function has a check for `! $value` and assigns the MongoDB default of ‘_id’ we should be able to omit the property.
1 parent 88d53cc commit 92f1089

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Jenssegers/Mongodb/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class Model extends BaseModel
3939
* @param mixed $value
4040
* @return mixed
4141
*/
42-
public function getIdAttribute($value)
42+
public function getIdAttribute($value = null)
4343
{
4444
// If we don't have a value for 'id', we will use the Mongo '_id' value.
4545
// This allows us to work with models in a more sql-like way.

0 commit comments

Comments
 (0)