Skip to content

first() returns and array instead of stdClass object #1059

@parth-vora-7

Description

@parth-vora-7

Hello,

I have setup two fresh Laravel 5.3 with different databases. One with MongoDB(using this package) and another with MySQL.

I have run this simple code on both setup:

$user = DB::table('users')->first();
dd($user);

For above code, Laravel with MySQL returns stdClass object whereas Laravel with MongoDB returns an array .

Why is that? Is there any way that I can make it same as Laravel MySQL i.e stdClass object?

Due to this different return type issue, I'm not able to use another package with Laravel MongoDB setup.

Any help would be appreciated.

Thanks,
Parth vora

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions