Laravel / Model / Compare 2 fields
Where Compare two fields
-
STEP
whereColumn()
Query
outputStudent::whereColumn('created_at','>','updated_at') select * from student where created_at > updated_at $snapFaces=SnapFaces::join('snap','snap_faces.snap_id','snap.snap_id') ->where(function ($query) { $query->whereColumn('snap.last_upload','>','snap_faces.last_compare') ->orWhereNull('snap_faces.last_compare'); }) ->whereNotNull('snap.last_upload')->get();