Lumen support? #470
Lumen support? #470
Comments
Did you uncommented the |
Sorry I forgot to mention that. But yes I did. I just tried migrations and seeding first. |
Having the same issue here, albeit I'm not trying migrations & seeding, just attempting to pull from an existing MongoDb database. As Lumen is just using the Illuminate\Database component I'm sure it's going to be fairly simple to get this all hooked up, but it's Friday afternoon and I'm having too much trouble concentrating to figure it out at the moment :) |
I created simple
It's works. |
@yohang88 did you make any other changes than adding the service provider to the boostrap/app.php? |
Also having trouble with this, same error |
@alex-LE
Maybe the tricky setting is This is my Model file
This is my
Response:
|
@yohang88 thanks! |
Disabling $app->withEloquent() works, but I consider this a workaround. |
Just realized that registering // bootstrap/app.php
// $app->withFacades();
$app->withEloquent();
$app->register('Jenssegers\Mongodb\MongodbServiceProvider'); But if you register before // bootstrap/app.php
// $app->withFacades();
$app->register('Jenssegers\Mongodb\MongodbServiceProvider');
$app->withEloquent(); |
You may want to use The Capsule Manager and then creating your own mongodb config at project root Take advantage by using the middleware to configure mongodb:
If you want to make it globally, you need to add it on the bootstrap file bootstrap/app.php
|
thx :) @krisanalfa |
@askmatey Keep rock, bro! @guns28 Anytime |
Thank you so much @krisanalfa |
Could someone add this as a PR to the documentation? |
When I try to install the package it show the following errprs. Problem 1 |
@zahiruldu You have to install PHP MongoDB first. You can do it via PECL installation.
|
I'm using Laravel Framework version 5.2.35 and the code is kind of different. Any update for this version?
|
Looks like you're using Laravel full, this issue is about Lumen. The instructions for the full framework should still work on 5.2.35. |
@yohang88 solution is working. My
|
hi guys
as you see, my default db is mongodb, but you can switch between databases easily when you create a Model class. for example if you want to work with mysql db you have to write: use Illuminate\Database\Eloquent\Model; class Car extends Model namespace App\Http\Controllers; use App\models\Car; class CarController extends Controller
}` enjoy it:)))) |
I am trying to install plugin "composer require jenssegers/mongodb" on my lumen project but it is not instlling. It give me given below error Problem 1 Installation failed, reverting ./composer.json to its original content. pleses help me |
Hi,
I loved using this with Laravel and would like to continue using this on Lumen. I tried the following:
$app->register('Jenssegers\Mongodb\MongodbServiceProvider');
But when I actually try to do something, I get:
InvalidArgumentException: Unsupported driver [mongodb]
So I guess even though I register the service provider, it does not create the necessary database connector for MongoDB? I know this Lumen is not officially supported, but is there any chance to get this working?
The text was updated successfully, but these errors were encountered: