khsing / laravel-world

provide countries, states, and cities relations and database.
MIT License
427 stars 89 forks source link

Mongodb support #27

Open doubleprincez opened 4 years ago

doubleprincez commented 4 years ago

I tried using this package with my mongodb project but got stuck in the seeding phase. This is the result i got from running php artisan world:init migrations error

Recreate: create a new project, add Jenssegers Laravel Mongodb to the project and configure it as the default database for the project. Install khsing Laravel World package and follow the installation steps.

Previous Debug Steps: I tried changing all migrations and seed to implement the specified mongodb alternatives in the root folder of khsing package in vendor but still unable to fix it but get this error:

Symfony\Component\Debug\Exception\FatalThrowableError
Call to a member function prepare() on null
muarachmann commented 4 years ago

This is perharps because mongodb doesn't support the sql snytax. Look he is trying to disable/enable before and after seeding the data. What you can do is check if the DB connection is SQLiteConnection, MySqlConnection or PostgresConnection or "MongoDB.." then perform the statement. However, I'am not versed with mongodb so you might have to look for a way to disable constraints there. Hope it helps

khsing commented 3 years ago

@doubleprincez I have not test in MongoDB. I am planing to remove relation database dependent. That may helps you.