An Eloquent Neo4j Graph Driver
Include the ongoing company in app/config/app.php :
The company shall register all the necessary classes with this package and also will alias the Model course to NeoEloquent in order to just expand NeoEloquent in your models.
in app/config/database.php or perhaps in situation of an configuration that is environment-based.php make neo4j your default connection:
Add the text defaults:
As easy as it’s, NeoEloquent will create the standard node label through the course title, in this instance it’s going to be :User . Learn about node labels right here
By using namespaces along with your models the label will look at the namespace that is full.
The generated label from that relationship will likely be VinelabCmsAdmin , this really is essential to make sure labels usually do not clash in instances where we introduce another Admin example like Vinelab\Blog\Admin then points gets messy with :Admin into the database.
Custom Node Labels
You might specify the label(s) you want to be utilized rather than the default created, also, they are instance sensitive and painful so they really will undoubtedly be kept as put right here.
NeoEloquent has a fallback help when it comes to $table adjustable which is used if discovered and there clearly was no $label defined from the model.
Usually do not concern yourself with the labels formatting, You may specify them as array(‘Label1’, ‘Label2’) or split them by a line : and prepending all of them with a : is optional.
Make it possible for soft deleting you’ll need certainly to utilize Vinelab\NeoEloquent\Eloquent\SoftDeletingTrait in place of Illuminate\Database\Eloquent\SoftDeletingTrait and simply like Eloquent you may need the $times in your models the following:
Let us proceed through a few examples of relationships between Nodes.