According to the Laravel documentation, the where method can be used to compare two columns by passing the column names as the values. So in the example provided, the correct syntax would be:
@Snapey Thanks for that info.
Concerning as I have a couple of apps still using L4.2
What happens if I use where() with 2 columns?
And, What happens if I use where() with 2 date type columns?
@Christofer As you’ve seen, what happens is that the query doesn’t work. The query will end up being SELECT * FROM table WHERE updated_at > 'created_at', comparing the column value to a string.
I’ve never used Laravel 4.2, but in later versions, I would use whereRaw():