thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.81k stars 2.67k forks source link

voyager + mongoDB #837

Closed omidahn closed 7 years ago

omidahn commented 7 years ago

Hi guys, is there any plans to make the voyager mongoDB friendly? ( i think refactoring models can do the trick)

abdgad commented 7 years ago

I myself don't have experience with mongodb, so I don't know the differences between it and traditional relational databases. However, Voyager makes use of Laravel and Doctrine DBAL, which don't support mongodb (at least by default). So I think it's not going to be simple to add mongodb support.

omidahn commented 7 years ago

I suggest you to take a look at this : https://github.com/jenssegers/laravel-mongodb it works well with eloquent, it can be done by changing model classes to extend use Jenssegers\Mongodb\Eloquent\Model as Eloquent instead of default laravel Eloquent.

marktopper commented 7 years ago

For the usage of the Eloquent model, we could make use of an alias there. So any Voyager models could extend VoyagerEloquent which can be aliased to the real Eloquent model in the service provider, and can be overwritten for your case. Thoughts?

omidahn commented 7 years ago

@marktopper I just tried it, the first problem was that i couldn't override voyager models, so (for the test purpose) i edited them manually to use use Jenssegers\Mongodb\Eloquent\Model and admin panel came up. when i tried to go to database page and edit collections (tables) , the second problem was that voyager did make use of Doctrine Driver and i ran to this error: class 'MongoDB\Database' does not have a method 'getDoctrineDriver'

abdgad commented 7 years ago

@omidahn the database section relies on Doctrine\DBAL.

marco-solare commented 7 years ago

@omidahn mongodb is one awesome database system, for prototyping / rapid development / MVPs and production systems alike. Its flexibility (being able to work schemeless), its intuitive way of quering data and its fault tolerance are teriffic to name just a few. I myself had a great time working with it for some time, also with laravel, I think it was the moloquent package I was using - did work flawlessly.

Now voyager seems to be a fantastic laravel5.4 based app I have been monitoring closely as it seems to be pretty promising for starting new apps and it may even easily replace some legacy boring cms systems we know besides offering standard functionality like users/roles/menus etc. Alot of effort is being put into voyager as it seems, respect!

I feel that alot of effort is put into the db design of voyager. Making Doctrine\DBAL work with mongo might turn out challenging I figure (have not yet researched). What is the benefit of being able to use voyager with mongo?

abdgad commented 7 years ago

The db section of Voyager is still in early stage of development. A lot of changes will be made to it. The main goal is to support SQL databases, because most people who use PHP, will most likely use a SQL database. When SQL databases are all supported and working well, we'll see what may be done to add support for other databases that are not SQL, including Mongo. However, this is not a priority at the moment.

omidahn commented 7 years ago

@marco-solare As you said , mongodb brings a lot of benefits , but there has been a few packages who focused to be compatible with it. Since i have found voyager one of the best packages for starting new projects (and most of my recent laravel-based projects are using mongoDB), I'm curious about voyager+mongo

Frondor commented 7 years ago

I suggest to stick with Laravel's implementation of database drivers, so if they start supporting mongoDBs, then voyager will do as well. As abdgad said, there's a lot of things to do before addressing something like this.

marktopper commented 7 years ago

I must agree with @Frondor on this one.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.