Skip to content

MongoDB not supported #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maciejstepie opened this issue Feb 10, 2023 · 3 comments
Open

MongoDB not supported #20

maciejstepie opened this issue Feb 10, 2023 · 3 comments

Comments

@maciejstepie
Copy link

In the Ticket model is use Illuminate\Database\Eloquent\Model but it won't work with relations to create tickets on users.
It will throw an error Call to a member function prepare() on null
It has to be use Jenssegers\Mongodb\Eloquent\Model.

Please add option to support mongoDB connection.

@ousid
Copy link
Member

ousid commented Feb 20, 2023

Did you add a mongodb configuration in config/databas.php in your laravel app?

Try to extend the Ticket Model, and alter the $connection property.

class Ticket extends \Coderflex\LaravelTicket\Models\Ticket
{
  protected $connection = 'mongodb';

 //
}

Because I'm not sure, on how to add a DB connection support into the package exactly, if the above solution does not work, feel free to open a PR, and I'll check it ASAP.

Thanks!

@n4ss1m
Copy link

n4ss1m commented Nov 13, 2024

MongoDB is supported via the mongodb/laravel-mongodb package, which is officially maintained by MongoDB. Check out the Laravel MongoDB documentation for more information.

https://laravel.com/docs/11.x/database#introduction

@ousid
Copy link
Member

ousid commented Nov 13, 2024

MongoDB is supported via the mongodb/laravel-mongodb package, which is officially maintained by MongoDB. Check out the Laravel MongoDB documentation for more information.

https://laravel.com/docs/11.x/database#introduction

Hi nassim.

Thanks for pointing this out. Feel free to open a PR at anytime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants