Skip to content

Commit 922680d

Browse files
committed
Moved upgrading to the bottom.
1 parent 1460b11 commit 922680d

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
1111
- [Laravel](#laravel)
1212
- [Lumen](#lumen)
1313
- [Non-Laravel projects](#non-laravel-projects)
14-
- [Upgrading](#upgrading)
15-
- [Upgrading from version 2 to 3](#upgrading-from-version-2-to-3)
1614
- [Testing](#testing)
1715
- [Configuration](#configuration)
1816
- [Eloquent](#eloquent)
@@ -39,6 +37,8 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
3937
- [Cross-Database Relationships](#cross-database-relationships)
4038
- [Authentication](#authentication)
4139
- [Queues](#queues)
40+
- [Upgrading](#upgrading)
41+
- [Upgrading from version 2 to 3](#upgrading-from-version-2-to-3)
4242

4343
Installation
4444
------------
@@ -100,46 +100,6 @@ $capsule->getDatabaseManager()->extend('mongodb', function($config, $name) {
100100
});
101101
```
102102

103-
Upgrading
104-
---------
105-
106-
#### Upgrading from version 2 to 3
107-
108-
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-
143103
Testing
144104
-------
145105

@@ -1104,3 +1064,43 @@ Last, add the service provider in `config/app.php`:
11041064
```php
11051065
Jenssegers\Mongodb\MongodbQueueServiceProvider::class,
11061066
```
1067+
1068+
Upgrading
1069+
---------
1070+
1071+
#### Upgrading from version 2 to 3
1072+
1073+
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.
1103+
1104+
```php
1105+
$books = $user->books()->sortBy('title')->get();
1106+
```

0 commit comments

Comments
 (0)