Skip to content

Remove legacy from readme #2586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 4 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ Laravel MongoDB

This package adds functionalities to the Eloquent model and Query builder for MongoDB, using the original Laravel API. *This library extends the original Laravel classes, so it uses exactly the same methods.*

This package was renamed to `mongodb/laravel-mongodb` because of a transfer of ownership to MongoDB, Inc.
It is compatible with Laravel 10.x. For older versions of Laravel, please refer to the [old versions](https://github.com/mongodb/laravel-mongodb/tree/3.9#laravel-version-compatibility).

- [Laravel MongoDB](#laravel-mongodb)
- [Installation](#installation)
- [Laravel version Compatibility](#laravel-version-compatibility)
- [Laravel](#laravel)
- [Lumen](#lumen)
- [Non-Laravel projects](#non-laravel-projects)
- [Testing](#testing)
- [Database Testing](#database-testing)
- [Configuration](#configuration)
Expand Down Expand Up @@ -52,67 +51,20 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
Installation
------------

Make sure you have the MongoDB PHP driver installed. You can find installation instructions at http://php.net/manual/en/mongodb.installation.php

### Laravel version Compatibility

| Laravel | Package | Maintained |
| :------ | :------------- | :----------------- |
| 9.x | 3.9.x | :white_check_mark: |
| 8.x | 3.8.x | :white_check_mark: |
| 7.x | 3.7.x | :x: |
| 6.x | 3.6.x | :x: |
| 5.8.x | 3.5.x | :x: |
| 5.7.x | 3.4.x | :x: |
| 5.6.x | 3.4.x | :x: |
| 5.5.x | 3.3.x | :x: |
| 5.4.x | 3.2.x | :x: |
| 5.3.x | 3.1.x or 3.2.x | :x: |
| 5.2.x | 2.3.x or 3.0.x | :x: |
| 5.1.x | 2.2.x or 3.0.x | :x: |
| 5.0.x | 2.1.x | :x: |
| 4.2.x | 2.0.x | :x: |
Make sure you have the MongoDB PHP driver installed. You can find installation instructions at https://php.net/manual/en/mongodb.installation.php

Install the package via Composer:

```bash
$ composer require mongodb/laravel-mongodb
```

### Laravel

In case your Laravel version does NOT autoload the packages, add the service provider to `config/app.php`:

```php
MongoDB\Laravel\MongodbServiceProvider::class,
```

### Lumen

For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`. In this file, you will also need to enable Eloquent. You must however ensure that your call to `$app->withEloquent();` is **below** where you have registered the `MongodbServiceProvider`:

```php
$app->register(MongoDB\Laravel\MongodbServiceProvider::class);

$app->withEloquent();
```

The service provider will register a MongoDB database extension with the original database manager. There is no need to register additional facades or objects.

When using MongoDB connections, Laravel will automatically provide you with the corresponding MongoDB objects.

### Non-Laravel projects

For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add:

```php
$capsule->getDatabaseManager()->extend('mongodb', function($config, $name) {
$config['name'] = $name;

return new MongoDB\Laravel\Connection($config);
});
```

Testing
-------

Expand Down