Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 199 forks source link

Do not return Node IDs #216

Closed guivazcabral closed 7 years ago

guivazcabral commented 7 years ago

Hi. Is it possible to not return Neo4j's internal ID when returning the model?

For example, i'm fetching Authors:

Author::take($limit)->orderBy($orderBy, $sort)->skip($skip)->get();

and the response is

[{
 "lastName": "Alegre",
"firstName": "Manuel",
"uuid": "83380596c47911e680dc0242ef3a492b",
"id": 360
}]

and I don't need the "id" property. Is there any way I can not return the id?

Mulkave commented 7 years ago

You may use the $hidden property in the model to specify the fields that you would like to hide.

class MyModel extends Model
{
    protected $hidden = [];
}