Skip to content

Commit 81d83a7

Browse files
authored
Merge pull request #3 from GromNaN/laravel-10
Update packages for Laravel 10
2 parents 9a1c000 + fb99d98 commit 81d83a7

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)