@@ -168,7 +168,7 @@ Keep in mind guarding still works, but you may experience unexpected behavior.
168
168
Schema
169
169
------
170
170
171
- The database driver also has (limited) schema builder support. You can
171
+ The database driver also has (limited) schema builder support. You can
172
172
conveniently manipulate collections and set indexes.
173
173
174
174
Basic Usage
@@ -351,7 +351,7 @@ relation definition.
351
351
352
352
.. code-block:: php
353
353
354
- $book = Book:: first();
354
+ $book = User::first()->books()-> first();
355
355
356
356
$user = $book->user;
357
357
@@ -455,7 +455,7 @@ Inserting and updating embedded models works similar to the ``hasOne`` relation:
455
455
$book->author()
456
456
->create(['name' => 'John Doe']);
457
457
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
459
459
release 2.0.0):
460
460
461
461
.. code-block:: php
@@ -476,13 +476,13 @@ You can replace the embedded model with a new model like this:
476
476
Cross-Database Relationships
477
477
----------------------------
478
478
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
480
480
across them.
481
481
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
483
483
based on the type of the related model.
484
484
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
486
486
to use the ``MongoDB\Laravel\Eloquent\HybridRelations`` trait.
487
487
488
488
**This functionality only works for ``hasOne``, ``hasMany`` and ``belongsTo``.**
0 commit comments