Skip to content

Commit

Permalink
PHPORM-140: Fix documentation for inverse embed relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Feb 21, 2024
1 parent 26a6824 commit 9f8f073
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/eloquent-models.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Keep in mind guarding still works, but you may experience unexpected behavior.
Schema
------

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

Basic Usage
Expand Down Expand Up @@ -351,7 +351,7 @@ relation definition.

.. code-block:: php

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

$user = $book->user;

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

You can update the embedded model using the ``save`` method (available since
You can update the embedded model using the ``save`` method (available since
release 2.0.0):

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

If you're using a hybrid MongoDB and SQL setup, you can define relationships
If you're using a hybrid MongoDB and SQL setup, you can define relationships
across them.

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

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

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

0 comments on commit 9f8f073

Please sign in to comment.