Skip to content

Database Transactions not working #1334

Closed
@klferreira

Description

@klferreira

Hello everyone, i stumbled on this issue today:

When i try to use laravel's transactions like this

DB::transaction(function() use($data) {
        $this->repository->create($data);
});

I get the following:

Call to a member function beginTransaction() on null
/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:108
/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:92
/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:23
/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:327
/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:221

I'm using laravel 5.4 and php version 7.1.

Is there any workaround for this issue?

This package is helping me out a lot with my personal project and i guess there is no other option for laravel and mongodb, so anything that solves it will do for me i guess.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions