laravel-mongodb icon indicating copy to clipboard operation
laravel-mongodb copied to clipboard

Violating default Laravel first() method behaviour

Open vishaltomar76 opened this issue 2 years ago • 0 comments

Description:

when i am using DB::table("users")->where("_id","xyz")->first(); this is returning an array but laravel default behaviour of first() method should return object not an array. If i am using Model query like User::where("_id","xyz")->first() it's returning object that is perfectly fine but in case of DB queries it returning array not object so here you are violating the default behaviour of first() method

Expected behaviour

first() method should return an object

Actual behaviour

but first() method is returning an array

vishaltomar76 avatar Aug 24 '21 07:08 vishaltomar76