Skip to content

Commit e7bc456

Browse files
authored
add note about collection() deprecation
1 parent 726078e commit e7bc456

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/fundamentals/database-collection.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,14 @@ Laravel retrieves results from the ``flowers`` collection:
145145

146146
Flower::where('name', 'Water Lily')->get()
147147

148+
.. note::
149+
150+
Starting in {+odm-short+} v4.8, the ``DB::collection()`` method
151+
is deprecated. As shown in the following example, you can use the ``DB::table()``
152+
method to access a MongoDB collection.
153+
148154
If you are unable to accomplish your operation by using an Eloquent
149-
model, you can access the query builder by calling the ``collection()``
155+
model, you can access the query builder by calling the ``table()``
150156
method on the ``DB`` facade. The following example shows the same query
151157
as in the preceding example, but the query is constructed by using the
152158
``DB::table()`` method:

0 commit comments

Comments
 (0)