@@ -287,8 +287,8 @@ the code:
287287 .. input:: /includes/eloquent-models/relationships/RelationshipController.php
288288 :language: php
289289 :dedent:
290- :start-after: begin many to many dynamic property example
291- :end-before: end many to many dynamic property example
290+ :start-after: begin many to many save
291+ :end-before: end many to many save
292292
293293 .. output::
294294 :language: json
@@ -416,27 +416,26 @@ created by running the code:
416416
417417 // Document in the "space_ships" collection
418418 {
419- _id: ObjectId('65e207b9aa167d29a3048853'),
420- name: 'The Millenium Falcon',
421- // ...
422- cargo: [
423- {
424- name: 'spice',
425- weight: 50,
426- // ...
427- _id: ObjectId('65e207b9aa167d29a3048854')
428- },
429- {
430- name: 'hyperdrive',
431- weight: 25,
432- // ...
433- _id: ObjectId('65e207b9aa167d29a3048855')
434- }
435- ]
419+ _id: ObjectId('65e207b9aa167d29a3048853'),
420+ name: 'The Millenium Falcon',
421+ // ...
422+ cargo: [
423+ {
424+ name: 'spice',
425+ weight: 50,
426+ // ...
427+ _id: ObjectId('65e207b9aa167d29a3048854')
428+ },
429+ {
430+ name: 'hyperdrive',
431+ weight: 25,
432+ // ...
433+ _id: ObjectId('65e207b9aa167d29a3048855')
434+ }
435+ ]
436436 }
437437
438-
439- .. _laravel-relationship-cross-database
438+ .. _laravel-relationship-cross-database:
440439
441440Cross-Database Relationships
442441----------------------------
@@ -474,24 +473,10 @@ stored in a MongoDB database:
474473The ``Passenger`` model defines a ``BelongsToMany`` relationship with
475474``SpaceShip`` as shown in the following example class:
476475
477- .. literalinclude:: /includes/eloquent-models/relationships/SpaceShipManyToMany.php
478- :language: php
479- :dedent:
480-
481- The following sample code shows how you can instantiate a model for each class
482- and add the relationship between them:
483-
484476.. literalinclude:: /includes/eloquent-models/relationships/PassengerCrossBelongsTo.php
485477 :language: php
486478 :dedent:
487479
488- The embedded model class omits the relationship definition as shown in the
489- following example class:
490-
491- .. literalinclude:: /includes/eloquent-models/relationships/CargoEmbedsMany.php
492- :language: php
493- :dedent:
494-
495480The following sample code shows how you can create a ``SpaceShip`` model in
496481a MySQL database and related ``Passenger`` models in a MongoDB database and
497482the data created by running the code. Click the :guilabel:`Output` button to
@@ -514,5 +499,4 @@ see sample MongoDB documents created by running the code:
514499 +------+----------+
515500 | 1234 | Nostromo |
516501 +------+----------+
517-
518502
0 commit comments