Skip to content

Commit fb99d98

Browse files
committed
Update packages for Laravel 10
- Removing asm89/stack-cors (v2.1.1) - Removing doctrine/instantiator (2.0.0) - Removing fruitcake/laravel-cors (v2.2.0) Deprecated because all CORS features are part of Laravel - Removing sebastian/resource-operations (3.0.3) - Upgrading laravel/framework (v9.52.15 => v10.23.0) - Locking laravel/prompts (v0.1.7) - Upgrading laravel/sail (v1.24.1 => v1.25.0) - Upgrading laravel/sanctum (v2.15.1 => v3.3.1) - Upgrading mongodb/laravel-mongodb (v3.9.5 => 4.0.0-rc1) - Upgrading monolog/monolog (2.9.1 => 3.4.0) - Upgrading nunomaduro/collision (v6.4.0 => v7.8.1) - Upgrading phpunit/php-code-coverage (9.2.27 => 10.1.5) - Upgrading phpunit/php-file-iterator (3.0.6 => 4.1.0) - Upgrading phpunit/php-invoker (3.1.1 => 4.0.0) - Upgrading phpunit/php-text-template (2.0.4 => 3.0.1) - Upgrading phpunit/php-timer (5.0.3 => 6.0.0) - Upgrading phpunit/phpunit (9.6.11 => 10.3.4) - Upgrading sebastian/cli-parser (1.0.1 => 2.0.0) - Upgrading sebastian/code-unit (1.0.8 => 2.0.0) - Upgrading sebastian/code-unit-reverse-lookup (2.0.3 => 3.0.0) - Upgrading sebastian/comparator (4.0.8 => 5.0.1) - Upgrading sebastian/complexity (2.0.2 => 3.0.1) - Upgrading sebastian/diff (4.0.5 => 5.0.3) - Upgrading sebastian/environment (5.1.5 => 6.0.1) - Upgrading sebastian/exporter (4.0.5 => 5.0.1) - Upgrading sebastian/global-state (5.0.6 => 6.0.1) - Upgrading sebastian/lines-of-code (1.0.3 => 2.0.1) - Upgrading sebastian/object-enumerator (4.0.4 => 5.0.0) - Upgrading sebastian/object-reflector (2.0.4 => 3.0.0) - Upgrading sebastian/recursion-context (4.0.5 => 5.0.0) - Upgrading sebastian/type (3.2.1 => 4.0.0) - Upgrading sebastian/version (3.0.2 => 4.0.1) - Upgrading spatie/laravel-ignition (1.6.4 => 2.3.0)
1 parent 9a1c000 commit fb99d98

File tree

9 files changed

+510
-689
lines changed

9 files changed

+510
-689
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This code was written to accompany [this tutorial article](https://www.mongodb.com/developer/languages/php/laravel-mongodb-tutorial/?utm_campaign=devrel).
44

5-
65
## Prerequisites
76
You'll need the following installed on your computer to follow along with this tutorial:
87

src/app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Kernel extends HttpKernel
1616
protected $middleware = [
1717
// \App\Http\Middleware\TrustHosts::class,
1818
\App\Http\Middleware\TrustProxies::class,
19-
\Fruitcake\Cors\HandleCors::class,
2019
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
20+
\Illuminate\Http\Middleware\HandleCors::class,
2121
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2222
\App\Http\Middleware\TrimStrings::class,
2323
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,

src/app/Models/Book.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
//use Illuminate\Database\Eloquent\Model;
88

99
// use this instead of the default "Illuminate\Database\Eloquent\Model"
10-
use Jenssegers\Mongodb\Eloquent\Model;
10+
use MongoDB\Laravel\Eloquent\Model;
1111

1212
class Book extends Model
1313
{
1414
use HasFactory;
15-
15+
1616
protected $fillable = ['title', 'author', 'isbn'];
1717

1818
protected $connection = 'mongodb';

src/app/Models/CustomerMongoDB.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Illuminate\Database\Eloquent\Factories\HasFactory;
66

77
//use Illuminate\Database\Eloquent\Model;
8-
use Jenssegers\Mongodb\Eloquent\Model;
8+
use MongoDB\Laravel\Eloquent\Model;
99

1010
class CustomerMongoDB extends Model
1111
{
@@ -14,9 +14,9 @@ class CustomerMongoDB extends Model
1414
// the selected database as defined in /config/database.php
1515
protected $connection = 'mongodb';
1616

17-
// equivalent to $table for MySQL
18-
protected $collection = 'laracoll';
17+
// equivalent to $table for MySQL
18+
protected $collection = 'laracoll';
1919

2020
// defines the schema's top-level properties.
21-
protected $fillable = ['guid','first_name', 'family_name', 'email', 'address'];
21+
protected $fillable = ['guid','first_name', 'family_name', 'email', 'address'];
2222
}

src/app/Models/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//use Illuminate\Database\Eloquent\Model;
77

88
// use this instead of the default "Illuminate\Database\Eloquent\Model"
9-
use Jenssegers\Mongodb\Eloquent\Model;
9+
use MongoDB\Laravel\Eloquent\Model;
1010

1111
class Post extends Model
1212
{
@@ -15,7 +15,7 @@ class Post extends Model
1515
// required for MongoDB, defined in /config/database.php
1616
protected $connection = 'mongodb';
1717

18-
// Normallt the table (collection in MDB lingo) would be the plural class name = "posts"
18+
// Normallt the table (collection in MDB lingo) would be the plural class name = "posts"
1919
// override it as follow
2020
protected $collection = 'laracoll';
2121

src/composer.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
"keywords": ["framework", "laravel"],
66
"license": "MIT",
77
"require": {
8-
"php": "^8.0",
9-
"fruitcake/laravel-cors": "^2.0.5",
8+
"php": "^8.1",
109
"guzzlehttp/guzzle": "^7.2",
11-
"mongodb/laravel-mongodb": "^3.9",
12-
"laravel/framework": "^9.0",
13-
"laravel/sanctum": "^2.14",
14-
"laravel/tinker": "^2.7"
10+
"mongodb/laravel-mongodb": "4.0.0-rc1",
11+
"laravel/framework": "^10.0",
12+
"laravel/sanctum": "^3.3",
13+
"laravel/tinker": "^2.8"
1514
},
1615
"require-dev": {
17-
"fakerphp/faker": "^1.9.1",
18-
"laravel/sail": "^1.23",
19-
"mockery/mockery": "^1.4.4",
20-
"nunomaduro/collision": "^6.1",
21-
"phpunit/phpunit": "^9.5.10",
22-
"spatie/laravel-ignition": "^1.0"
16+
"fakerphp/faker": "^1.23",
17+
"laravel/sail": "^1.25",
18+
"mockery/mockery": "^1.6",
19+
"nunomaduro/collision": "^7.8",
20+
"phpunit/phpunit": "^10.0",
21+
"spatie/laravel-ignition": "^2.3"
2322
},
2423
"autoload": {
2524
"psr-4": {

0 commit comments

Comments
 (0)