So I am working on a website with a laravel framework and using postman to test my code, I am writing code in php and am not able to get specific values from the database table in my code.
I've tried variations of select, where and other functions like pluck()
and get()
yet I keep getting an error. I am unsure on how to put it in an array or get it out of an array.
I've tried:
$passwordResult = DB::table('users')->where('userName', $userName)->get('password')->toArray();
$passwordResult = DB::table('users')->where('userName', $userName)->value('password');
$passwordResult = DB::table('users')->pluck('password');
I want return any value and see it in postman so I can start working on getting specific values. The error I get was that
"Cannot use object of type Illuminate\Database\Query\Builder as array"