jenssegers / laravel-mongodb-session

A MongoDB session driver for Laravel
77 stars 27 forks source link

another: Driver [mongodb] not supported #6

Closed wasilak closed 10 years ago

wasilak commented 10 years ago

Hey,

I just installed MongoDB session and I can't get it to work. I've done everything according to your instructions and still I get error

Driver [mongodb] not supported

image

I'm currently using your main MongoDB package and it is working without problem (great job, btw). I figured that this should be a plug'n'play thing, but sadly - it's not.

Thanks for any help :)

jenssegers commented 10 years ago

Did you register the service provider?

wasilak commented 10 years ago

Yes, I did:

'providers' => array(
...
        'Jenssegers\Mongodb\MongodbServiceProvider',
        'Jenssegers\Mongodb\Auth\ReminderServiceProvider',
        'Jenssegers\Mongodb\Session\SessionServiceProvider',
...
},

I also have it installed (updated) with composer. I really don't understand why it's not registering properly. It worked with mongodb package without any problems :/

Just let me know I i can provide you with any more information which might be helpful with debugging this issue.

Thanks again.

wasilak commented 10 years ago

Hey man, I fixed it :)

It wasn't anything wrong with your code, though. My apologies.

You see, I'm using package https://github.com/edvinaskrucas/notification which has provider Krucas\Notification\NotificationServiceProvider. In this provider there is code:

public function register()
{
// some code
$this->app->bind('Krucas\Notification\Subscriber', function ($app) {
            return new Subscriber($app['session.store'], $app['config']);
        });
// some more code
}

which I think messes up session driver registration.

All I had to do was load your session provider before mentioned notification service and now everything works :)