0

I have just started using Laravel. I have not used Laravel Eloquent before. So I am directly using it on graph database using NeoEloquent. I know I can create relationship using hasMany() and attach() methods. But I want to create relationship only once. Has anybody used NeoEloquent for creating Unique Relationship.

Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
Sumit Patil
  • 556
  • 1
  • 5
  • 19

1 Answers1

0

You may use the hasOne()relationship instead of hasMany() which will ensure that only one relationship of the specified type exists for the model.

mulkave
  • 831
  • 1
  • 10
  • 22