File tree Expand file tree Collapse file tree 4 files changed +25
-46
lines changed
fundamentals/write-operations
includes/fundamentals/write-operations Expand file tree Collapse file tree 4 files changed +25
-46
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ This section provides examples of the following delete operations:
30
30
- :ref:`Delete one document <laravel-fundamentals-delete-one>`
31
31
- :ref:`Delete multiple documents <laravel-fundamentals-delete-many>`
32
32
33
+ .. include:: /includes/fundamentals/write-operations/sample-model-section.rst
34
+
33
35
.. _laravel-fundamentals-delete-one:
34
36
35
37
Delete One Document
Original file line number Diff line number Diff line change @@ -36,29 +36,7 @@ of the Schema Builder documentation.
36
36
To learn more about Eloquent models in the {+odm-short+}, see the
37
37
:ref:`laravel-eloquent-models` section.
38
38
39
- .. _laravel-fundamentals-write-insert-model:
40
-
41
- Sample Model
42
- ~~~~~~~~~~~~
43
-
44
- The insert operations in this guide reference the following Eloquent
45
- model class:
46
-
47
- .. literalinclude:: /includes/fundamentals/write-operations/Concert.php
48
- :language: php
49
- :dedent:
50
- :caption: Concert.php
51
-
52
- .. tip::
53
-
54
- The ``$fillable`` attribute lets you use Laravel mass assignment for insert
55
- operations. To learn more about mass assignment, see
56
- :ref:`laravel-model-mass-assignment` in the Eloquent Model Class
57
- documentation.
58
-
59
- The ``$casts`` attribute instructs Laravel to convert attributes to common
60
- data types. To learn more, see `Attribute Casting <https://laravel.com/docs/{+laravel-docs-version+}/eloquent-mutators#attribute-casting>`__
61
- in the Laravel documentation.
39
+ .. include:: /includes/fundamentals/write-operations/sample-model-section.rst
62
40
63
41
Insert One Document
64
42
-------------------
Original file line number Diff line number Diff line change @@ -37,29 +37,7 @@ This guide provides examples of the following update operations:
37
37
- :ref:`Update or insert in a single operation <laravel-modify-documents-upsert>`
38
38
- :ref:`Update arrays in a document <laravel-modify-documents-arrays>`
39
39
40
- .. _laravel-fundamentals-write-modify-model:
41
-
42
- Sample Model
43
- ~~~~~~~~~~~~
44
-
45
- The update operations in this guide reference the following Eloquent
46
- model class:
47
-
48
- .. literalinclude:: /includes/fundamentals/write-operations/Concert.php
49
- :language: php
50
- :dedent:
51
- :caption: Concert.php
52
-
53
- .. tip::
54
-
55
- The ``$fillable`` attribute lets you use Laravel mass assignment for insert
56
- operations. To learn more about mass assignment, see
57
- :ref:`laravel-model-mass-assignment` in the Eloquent Model Class
58
- documentation.
59
-
60
- The ``$casts`` attribute instructs Laravel to convert attributes to common
61
- data types. To learn more, see `Attribute Casting <https://laravel.com/docs/{+laravel-docs-version+}/eloquent-mutators#attribute-casting>`__
62
- in the Laravel documentation.
40
+ .. include:: /includes/fundamentals/write-operations/sample-model-section.rst
63
41
64
42
.. _laravel-modify-documents-update-one:
65
43
Original file line number Diff line number Diff line change
1
+ Sample Model
2
+ ~~~~~~~~~~~~
3
+
4
+ The operations in this guide reference the following Eloquent
5
+ model class:
6
+
7
+ .. literalinclude :: /includes/fundamentals/write-operations/Concert.php
8
+ :language: php
9
+ :dedent:
10
+ :caption: Concert.php
11
+
12
+ .. tip ::
13
+
14
+ The ``$fillable `` attribute lets you use Laravel mass assignment for insert
15
+ operations. To learn more about mass assignment, see
16
+ :ref: `laravel-model-mass-assignment ` in the Eloquent Model Class
17
+ documentation.
18
+
19
+ The ``$casts `` attribute instructs Laravel to convert attributes to common
20
+ data types. To learn more, see `Attribute Casting <https://laravel.com/docs/{+laravel-docs-version+}/eloquent-mutators#attribute-casting >`__
21
+ in the Laravel documentation.
You can’t perform that action at this time.
0 commit comments