php - Need to compare two rows from the DB in Laravel -


i have table users in laravel.

a user has, among other things, id , owner_id.

i want perform query owners. means, id equal owner_id.

users::where('id','owner_id')->get(); 

something this. didn't work obviously.

any suggestions?

use wherecolumn instead.

users::wherecolumn('id','owner_id')->get(); 

with where, you're looking literal string 'owner_id'.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

minify - Minimizing css files -

php - How to remove letter in front of the word laravel -