You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this new major release which supports the new MongoDB PHP extension, we also moved the location of the Model class and replaced the MySQL model class with a trait.
109
-
110
-
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files or your registered alias.
111
-
112
-
```php
113
-
use Jenssegers\Mongodb\Eloquent\Model;
114
-
115
-
class User extends Model
116
-
{
117
-
//
118
-
}
119
-
```
120
-
121
-
If you are using hybrid relations, your MySQL classes should now extend the original Eloquent model class `Illuminate\Database\Eloquent\Model` instead of the removed `Jenssegers\Eloquent\Model`.
122
-
123
-
Instead use the new `Jenssegers\Mongodb\Eloquent\HybridRelations` trait. This should make things more clear as there is only one single model class in this package.
124
-
125
-
```php
126
-
use Jenssegers\Mongodb\Eloquent\HybridRelations;
127
-
128
-
class User extends Model
129
-
{
130
-
131
-
use HybridRelations;
132
-
133
-
protected $connection = 'mysql';
134
-
}
135
-
```
136
-
137
-
Embedded relations now return an `Illuminate\Database\Eloquent\Collection` rather than a custom Collection class. If you were using one of the special methods that were available, convert them to Collection operations.
138
-
139
-
```php
140
-
$books = $user->books()->sortBy('title')->get();
141
-
```
142
-
143
103
Testing
144
104
-------
145
105
@@ -1104,3 +1064,43 @@ Last, add the service provider in `config/app.php`:
In this new major release which supports the new MongoDB PHP extension, we also moved the location of the Model class and replaced the MySQL model class with a trait.
1074
+
1075
+
Please change all `Jenssegers\Mongodb\Model` references to `Jenssegers\Mongodb\Eloquent\Model` either at the top of your model files or your registered alias.
1076
+
1077
+
```php
1078
+
use Jenssegers\Mongodb\Eloquent\Model;
1079
+
1080
+
class User extends Model
1081
+
{
1082
+
//
1083
+
}
1084
+
```
1085
+
1086
+
If you are using hybrid relations, your MySQL classes should now extend the original Eloquent model class `Illuminate\Database\Eloquent\Model` instead of the removed `Jenssegers\Eloquent\Model`.
1087
+
1088
+
Instead use the new `Jenssegers\Mongodb\Eloquent\HybridRelations` trait. This should make things more clear as there is only one single model class in this package.
1089
+
1090
+
```php
1091
+
use Jenssegers\Mongodb\Eloquent\HybridRelations;
1092
+
1093
+
class User extends Model
1094
+
{
1095
+
1096
+
use HybridRelations;
1097
+
1098
+
protected $connection = 'mysql';
1099
+
}
1100
+
```
1101
+
1102
+
Embedded relations now return an `Illuminate\Database\Eloquent\Collection` rather than a custom Collection class. If you were using one of the special methods that were available, convert them to Collection operations.
0 commit comments