You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/filesystems.txt
+14-12Lines changed: 14 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ to use the ``gridfs`` driver in ``config/filesystems.php``:
47
47
],
48
48
],
49
49
50
-
You can configure the disk the following settings in ``config/filesystems.php``:
50
+
You can configure the following settings in ``config/filesystems.php``:
51
51
52
52
.. list-table::
53
53
:header-rows: 1
@@ -60,7 +60,7 @@ You can configure the disk the following settings in ``config/filesystems.php``:
60
60
- **Required**. Specifies the filesystem driver to use. Must be ``gridfs`` for MongoDB.
61
61
62
62
* - ``connection``
63
-
- The database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
63
+
- Database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
64
64
65
65
* - ``database``
66
66
- Name of the MongoDB database for the GridFS bucket. The driver uses the database of the connection if a database is not specified.
@@ -71,7 +71,7 @@ You can configure the disk the following settings in ``config/filesystems.php``:
71
71
* - ``prefix``
72
72
- Specifies a prefix for the name of the files that are stored in the bucket. Using a distinct bucket is recommended
73
73
in order to store the files in a different collection, instead of using a prefix.
74
-
The prefix should not start with a leading slash ``/``.
74
+
The prefix should not start with a leading slash (``/``).
75
75
76
76
* - ``read-only``
77
77
- If ``true``, writing to the GridFS bucket is disabled. Write operations will return ``false`` or throw exceptions
@@ -106,9 +106,10 @@ In this case, the options ``connection`` and ``database`` are ignored:
106
106
Usage
107
107
-----
108
108
109
-
A benefit of using Laravel Filesystem is that it provides a common interface
110
-
for all the supported file systems. You can use the ``gridfs`` disk in the same
111
-
way as the ``local`` disk.
109
+
Laravel Filesystem provides a common interface for all the supported file systems.
110
+
You can use the ``gridfs`` disk in the same way as the ``local`` disk.
111
+
112
+
The following example writes a file to the ``gridfs`` disk, then reads the file:
112
113
113
114
.. code-block:: php
114
115
@@ -127,9 +128,10 @@ in the Laravel documentation.
127
128
Versioning
128
129
----------
129
130
130
-
File names in GridFS are metadata in file documents, which are identified by
131
-
unique ObjectIDs. If multiple documents share the same file name, they are
132
-
considered "revisions" and further distinguished by creation timestamps.
131
+
GridFS creates file documents for each uploaded file. These documents contain
132
+
metadata, including the file name and a unique ObjectId. If multiple documents
133
+
share the same file name, they are considered "revisions" and further
134
+
distinguished by creation timestamps.
133
135
134
136
The Laravel MongoDB integration uses the GridFS Flysystem adapter. It interacts
135
137
with file revisions in the following ways:
@@ -140,7 +142,7 @@ with file revisions in the following ways:
140
142
- Deleting a file deletes all the revisions of this file name
141
143
142
144
The GridFS Adapter for Flysystem does not provide access to a specific revision
143
-
of a filename. You must use the
145
+
of a file name. You must use the
144
146
`GridFS API <https://www.mongodb.com/docs/php-library/current/tutorial/gridfs/>`__
145
147
if you need to work with revisions, as shown in the following code:
146
148
@@ -155,5 +157,5 @@ if you need to work with revisions, as shown in the following code:
155
157
156
158
.. note::
157
159
158
-
If you use a prefix the Filesystem component, you will have to handle it
159
-
by yourself when using the GridFS API directly.
160
+
If you specify the ``prefix`` Filesystem setting, you will have to explicitly
161
+
prepend the file names when using the GridFS API directly.
0 commit comments