Laravel 5 NeoEloquent findByProperty

384 Views Asked by At

Im integratting Neo4j and Laravel 5 with NeoEloquent. I cant get a node by a property, only by node id like the example:

User::find(1);

What I want:

User::findByName('Some Name');
1

There are 1 best solutions below

0
On BEST ANSWER

The typical way to get Eloquent to do this is:

User::whereName('Some Name')->first()

You could add a static findByName function to your User model to do this as User::findByName if you like.