Skip to content

Commit 5388dd0

Browse files
authored
PHPORM-140: Fix documentation for inverse embed relationships (mongodb#2734)
1 parent 26a6824 commit 5388dd0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/eloquent-models.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Keep in mind guarding still works, but you may experience unexpected behavior.
168168
Schema
169169
------
170170

171-
The database driver also has (limited) schema builder support. You can
171+
The database driver also has (limited) schema builder support. You can
172172
conveniently manipulate collections and set indexes.
173173

174174
Basic Usage
@@ -351,7 +351,7 @@ relation definition.
351351

352352
.. code-block:: php
353353

354-
$book = Book::first();
354+
$book = User::first()->books()->first();
355355

356356
$user = $book->user;
357357

@@ -455,7 +455,7 @@ Inserting and updating embedded models works similar to the ``hasOne`` relation:
455455
$book->author()
456456
->create(['name' => 'John Doe']);
457457

458-
You can update the embedded model using the ``save`` method (available since
458+
You can update the embedded model using the ``save`` method (available since
459459
release 2.0.0):
460460

461461
.. code-block:: php
@@ -476,13 +476,13 @@ You can replace the embedded model with a new model like this:
476476
Cross-Database Relationships
477477
----------------------------
478478

479-
If you're using a hybrid MongoDB and SQL setup, you can define relationships
479+
If you're using a hybrid MongoDB and SQL setup, you can define relationships
480480
across them.
481481

482-
The model will automatically return a MongoDB-related or SQL-related relation
482+
The model will automatically return a MongoDB-related or SQL-related relation
483483
based on the type of the related model.
484484

485-
If you want this functionality to work both ways, your SQL-models will need
485+
If you want this functionality to work both ways, your SQL-models will need
486486
to use the ``MongoDB\Laravel\Eloquent\HybridRelations`` trait.
487487

488488
**This functionality only works for ``hasOne``, ``hasMany`` and ``belongsTo``.**

0 commit comments

Comments
 (0)