Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ This library version introduces the following breaking changes:
of this behavior, you cannot have two separate ``id`` and ``_id`` fields in your
documents.

- Removes support for the ``$collection`` property and associated methods.
The following list contains the removed methods and provides alternative methods
that you can use to replace the functionality:

- ``Model::collection()``: use ``Model::table()``
- ``DB::collection()``: use ``DB::table()``
- ``Connection::collection()``: use ``Connection::table()``
- ``Schema::collection()``: use ``Schema::table()``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there is only 2 methods removed in MongoDB\Laravel\Connection and MongoDB\Laravel\Schema\Builder, where they can be used as instance method.

But they are exposed in the Laravel facades Illuminate\Support\Facades\DB and Illuminate\Support\Facades, which expose them as static method. (Yes, this is very confusing).

Suggested change
- ``Model::collection()``: use ``Model::table()``
- ``DB::collection()``: use ``DB::table()``
- ``Connection::collection()``: use ``Connection::table()``
- ``Schema::collection()``: use ``Schema::table()``
- ``DB::collection()``: use ``DB::table()``
- ``Schema::collection()``: use ``Schema::table()``

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I see, updated! Should I mention the static methods here?


.. _laravel-breaking-changes-v4.x:

Version 4.x Breaking Changes
Expand Down
Loading