From cf9c9b10900e3c487f021802a7446431ea7405f7 Mon Sep 17 00:00:00 2001 From: Rea Rustagi <85902999+rustagir@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:55:22 -0400 Subject: [PATCH] DOCSP-43539: v5 release (#3154) * DOCSP-43539: v5 release * toc reshuffle --- docs/compatibility.txt | 2 +- .../framework-compatibility-laravel.rst | 2 +- docs/index.txt | 22 ++++--- docs/upgrade.txt | 58 +++++++++---------- 4 files changed, 44 insertions(+), 40 deletions(-) diff --git a/docs/compatibility.txt b/docs/compatibility.txt index e02bda581..fb253f888 100644 --- a/docs/compatibility.txt +++ b/docs/compatibility.txt @@ -15,7 +15,7 @@ Compatibility :class: singlecol .. meta:: - :keywords: laravel 9, laravel 10, laravel 11, 4.0, 4.1, 4.2 + :keywords: laravel 9, laravel 10, laravel 11, 4.0, 4.1, 4.2, 5.0 Laravel Compatibility --------------------- diff --git a/docs/includes/framework-compatibility-laravel.rst b/docs/includes/framework-compatibility-laravel.rst index 19bcafc1a..bdfbd4d4c 100644 --- a/docs/includes/framework-compatibility-laravel.rst +++ b/docs/includes/framework-compatibility-laravel.rst @@ -7,7 +7,7 @@ - Laravel 10.x - Laravel 9.x - * - 4.2 to 4.8 + * - 4.2 to 5.0 - ✓ - ✓ - diff --git a/docs/index.txt b/docs/index.txt index 12269e0c4..b767d4247 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -14,8 +14,9 @@ :maxdepth: 1 /quick-start - /usage-examples Release Notes + /upgrade + /usage-examples /fundamentals /eloquent-models /query-builder @@ -27,7 +28,6 @@ /issues-and-help /feature-compatibility /compatibility - /upgrade Introduction ------------ @@ -52,6 +52,17 @@ Learn how to add the {+odm-short+} to a Laravel web application, connect to MongoDB hosted on MongoDB Atlas, and begin working with data in the :ref:`laravel-quick-start` section. +Upgrade Versions +---------------- + +.. important:: + + {+odm-long+} v5.0 introduces breaking changes that might affect how you + upgrade your application from a v4.x version. + +Learn what changes you must make to your application to upgrade between +major versions in the :ref:`laravel-upgrading` section. + Usage Examples -------------- @@ -94,10 +105,3 @@ Compatibility To learn more about which versions of {+odm-long+} and Laravel are compatible, see the :ref:`laravel-compatibility` section. - -Upgrade Versions ----------------- - -Learn what changes you must make to your application to upgrade versions in -the :ref:`laravel-upgrading` section. - diff --git a/docs/upgrade.txt b/docs/upgrade.txt index a992197f3..17d44cbb3 100644 --- a/docs/upgrade.txt +++ b/docs/upgrade.txt @@ -124,41 +124,41 @@ This library version introduces the following breaking changes: older versions compared to v5.0: .. code-block:: php - :emphasize-lines: 10-11 - - use MongoDB\Laravel\Eloquent\Model; - - class User extends Model - { - protected $keyType = 'string'; - - // older versions - protected $collection = 'app_user'; - - // v5.0 - protected $table = 'app_user'; - - ... - } + :emphasize-lines: 10-11 + + 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 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: 9-11 - - 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); + :emphasize-lines: 9-11 + + 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: