Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PatrickL's avatar

MongoDB and Laravel Passport

Hey,

I am building an app that requires using MongoDB as the database backend. For this, I plan to use this package. https://github.com/jenssegers/laravel-mongodb

The app also requires OAuth support. So, I wanted to use Laravel Passport. However, I notice that Laravel passport has its own migrations, which seems to be SQL tables as opposed to NoSQL (MongoDB collections). It also seems I will need to keep track of roles. I was looking into Entrust (https://github.com/Zizaco/entrust) which has its own migrations, hence the same dangling question.

Would I need to use both an SQL and NoSQL database to support all these requirements or is there a way to only use MongoDB for everything?

Thanks.

0 likes
3 replies
D9705996's avatar

There isnt anything inn the official documentation but this comment states MongoDB isn't officially supported. You might want to try your luck and see what happens if you follow the install for both packages with MongoDB and hope that any issues are easy to solve ;-)

If not you are looking at using a combination of MySQL (or other) and MongoDB database connections.

1 like
D9705996's avatar

@PATRICKL - I would create a new laravel application in your dev environment and pull in all the packages you need and spend a bit of time trying to get them to play together. You never know it might not be too bad. Just read any errors you get in the logs as they will help you narrow down the root cause (and make googling that much easier) and if you find yourself going down the rabbit hole and getting nowhere then stop and look to SQL & NoSQL hybrid approach

Please or to participate in this conversation.