@@ -287,8 +287,8 @@ the code:
287
287
.. input:: /includes/eloquent-models/relationships/RelationshipController.php
288
288
:language: php
289
289
: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
292
292
293
293
.. output::
294
294
:language: json
@@ -416,27 +416,26 @@ created by running the code:
416
416
417
417
// Document in the "space_ships" collection
418
418
{
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
+ ]
436
436
}
437
437
438
-
439
- .. _laravel-relationship-cross-database
438
+ .. _laravel-relationship-cross-database:
440
439
441
440
Cross-Database Relationships
442
441
----------------------------
@@ -474,24 +473,10 @@ stored in a MongoDB database:
474
473
The ``Passenger`` model defines a ``BelongsToMany`` relationship with
475
474
``SpaceShip`` as shown in the following example class:
476
475
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
-
484
476
.. literalinclude:: /includes/eloquent-models/relationships/PassengerCrossBelongsTo.php
485
477
:language: php
486
478
:dedent:
487
479
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
-
495
480
The following sample code shows how you can create a ``SpaceShip`` model in
496
481
a MySQL database and related ``Passenger`` models in a MongoDB database and
497
482
the 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:
514
499
+------+----------+
515
500
| 1234 | Nostromo |
516
501
+------+----------+
517
-
518
502
0 commit comments