@@ -124,41 +124,41 @@ This library version introduces the following breaking changes:
124
124
older versions compared to v5.0:
125
125
126
126
.. code-block:: php
127
- :emphasize-lines: 10-11
128
-
129
- use MongoDB\Laravel\Eloquent\Model;
130
-
131
- class User extends Model
132
- {
133
- protected $keyType = 'string';
134
-
135
- // older versions
136
- protected $collection = 'app_user';
137
-
138
- // v5.0
139
- protected $table = 'app_user';
140
-
141
- ...
142
- }
127
+ :emphasize-lines: 10-11
128
+
129
+ use MongoDB\Laravel\Eloquent\Model;
130
+
131
+ class User extends Model
132
+ {
133
+ protected $keyType = 'string';
134
+
135
+ // older versions
136
+ protected $collection = 'app_user';
137
+
138
+ // v5.0
139
+ protected $table = 'app_user';
140
+
141
+ ...
142
+ }
143
143
144
144
This release also modifies the associated ``DB`` and ``Schema`` methods for
145
145
accessing a MongoDB collection. The following code shows how to access the
146
146
``app_user`` collection in older versions compared to v5.0:
147
147
148
148
.. code-block:: php
149
- :emphasize-lines: 9-11
150
-
151
- use Illuminate\Support\Facades\Schema;
152
- use Illuminate\Support\Facades\DB;
153
- use MongoDB\Laravel\Schema\Blueprint;
154
-
155
- // older versions
156
- Schema::collection('app_user', function (Blueprint $collection) { ... });
157
- DB::collection('app_user')->find($id);
158
-
159
- // v5.0
160
- Schema::table('app_user', function (Blueprint $table) { ... });
161
- DB::table('app_user')->find($id);
149
+ :emphasize-lines: 9-11
150
+
151
+ use Illuminate\Support\Facades\Schema;
152
+ use Illuminate\Support\Facades\DB;
153
+ use MongoDB\Laravel\Schema\Blueprint;
154
+
155
+ // older versions
156
+ Schema::collection('app_user', function (Blueprint $collection) { ... });
157
+ DB::collection('app_user')->find($id);
158
+
159
+ // v5.0
160
+ Schema::table('app_user', function (Blueprint $table) { ... });
161
+ DB::table('app_user')->find($id);
162
162
163
163
.. _laravel-breaking-changes-v4.x:
164
164
0 commit comments