From 226756fddce6b1aef81a1624fb863b3db9420b08 Mon Sep 17 00:00:00 2001 From: norareidy Date: Thu, 5 Sep 2024 15:43:15 -0400 Subject: [PATCH 1/7] DOCSP-42956: Remove support --- docs/upgrade.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index fed27d862..8801e2ef0 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -79,6 +79,13 @@ 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 the following associated + methods: + + - ``Model::collection()``. Instead, use ``Model::table()``. + - ``Connection::collection()``. Instead, use ``Connection::table()``. + - ``Schema::collection()``. Instead, use ``Schema::table()``. + .. _laravel-breaking-changes-v4.x: Version 4.x Breaking Changes From 82679a7f9472d73d46f3b81670c0b38ca53c35e2 Mon Sep 17 00:00:00 2001 From: norareidy Date: Thu, 5 Sep 2024 15:55:28 -0400 Subject: [PATCH 2/7] edit --- docs/upgrade.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 8801e2ef0..515108c5e 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -83,6 +83,7 @@ This library version introduces the following breaking changes: methods: - ``Model::collection()``. Instead, use ``Model::table()``. + - ``DB::collection()``. Instead, use ``DB::table()``. - ``Connection::collection()``. Instead, use ``Connection::table()``. - ``Schema::collection()``. Instead, use ``Schema::table()``. From 7224c7225dde581c3d30e8a7c9664441f8408b4a Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 6 Sep 2024 09:53:07 -0400 Subject: [PATCH 3/7] RR feedback --- docs/upgrade.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 515108c5e..575a38760 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -79,13 +79,14 @@ 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 the following associated - methods: +- 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()``. Instead, use ``Model::table()``. - - ``DB::collection()``. Instead, use ``DB::table()``. - - ``Connection::collection()``. Instead, use ``Connection::table()``. - - ``Schema::collection()``. Instead, use ``Schema::table()``. + - ``Model::collection()``: use ``Model::table()`` + - ``DB::collection()``: use ``DB::table()`` + - ``Connection::collection()``: use ``Connection::table()`` + - ``Schema::collection()``: use ``Schema::table()`` .. _laravel-breaking-changes-v4.x: From 1b9fb2dc11d230716880c4b4cef0271963ce567f Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 6 Sep 2024 11:26:20 -0400 Subject: [PATCH 4/7] JT feedback --- docs/upgrade.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 575a38760..f818e8450 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -83,10 +83,8 @@ This library version introduces the following breaking changes: 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()`` + - ``Schema::collection()``: use ``Schema::table()`` .. _laravel-breaking-changes-v4.x: From fef5137f0b6d203144247cbd96f9c174eb42a61d Mon Sep 17 00:00:00 2001 From: norareidy Date: Fri, 6 Sep 2024 11:27:30 -0400 Subject: [PATCH 5/7] fix --- docs/upgrade.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index f818e8450..320734c49 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -84,7 +84,7 @@ This library version introduces the following breaking changes: that you can use to replace the functionality: - ``DB::collection()``: use ``DB::table()`` - - ``Schema::collection()``: use ``Schema::table()`` + - ``Schema::collection()``: use ``Schema::table()`` .. _laravel-breaking-changes-v4.x: From 151bb98c8fef192758d4983b107ac72191f4353f Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 10 Sep 2024 10:17:45 -0400 Subject: [PATCH 6/7] JT feedback --- docs/upgrade.txt | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 320734c49..9a0264bbc 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -79,12 +79,46 @@ 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: +- Removes support for the ``$collection`` property. The following code shows + how to specify a MongoDB collection name in your User class in older versions + compared to v5.0: - - ``DB::collection()``: use ``DB::table()`` - - ``Schema::collection()``: use ``Schema::table()`` + .. code-block:: php + :emphasize-lines: 11-12 + + use MongoDB\Laravel\Eloquent\Model; + + class User extends Model + { + protected $keyType = 'string'; + + // older versions + protected $collection = 'app_user'; + + // v5.0 + protected $table = 'app_user'; + + ... + } + + This release also updates the associated ``DB`` and ``Schema`` methods for + accessing a MongoDB collection. The following code shows how to access the + ``app_user`` collection in older versions compared to v5.0: + + .. code-block:: php + :emphasize-lines: 10-12 + + use Illuminate\Support\Facades\Schema; + use Illuminate\Support\Facades\DB; + use MongoDB\Laravel\Schema\Blueprint; + + // older versions + Schema::collection('app_user', function (Blueprint $collection) { ... }); + DB::collection('app_user')->find($id); + + // v5.0 + Schema::table('app_user', function (Blueprint $table) { ... }); + DB::table('app_user')->find($id); .. _laravel-breaking-changes-v4.x: From 5fe5e05cc0b151de5290fc89ec2c6a939e1ea4d0 Mon Sep 17 00:00:00 2001 From: norareidy Date: Tue, 10 Sep 2024 10:25:34 -0400 Subject: [PATCH 7/7] edits --- docs/upgrade.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/upgrade.txt b/docs/upgrade.txt index 9a0264bbc..2dcf92619 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -80,11 +80,11 @@ This library version introduces the following breaking changes: documents. - Removes support for the ``$collection`` property. The following code shows - how to specify a MongoDB collection name in your User class in older versions - compared to v5.0: + how to assign a MongoDB collection to a variable in your ``User`` class in + older versions compared to v5.0: .. code-block:: php - :emphasize-lines: 11-12 + :emphasize-lines: 10-11 use MongoDB\Laravel\Eloquent\Model; @@ -101,12 +101,12 @@ This library version introduces the following breaking changes: ... } - This release also updates the associated ``DB`` and ``Schema`` methods for + This release also modifies the associated ``DB`` and ``Schema`` methods for accessing a MongoDB collection. The following code shows how to access the ``app_user`` collection in older versions compared to v5.0: .. code-block:: php - :emphasize-lines: 10-12 + :emphasize-lines: 9-11 use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\DB;