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

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -