You can use whereColumn
method to compare the values of two columns.
1return Task::whereColumn('created_at', 'updated_at')->get();2// pass a comparison operator3return Task::whereColumn('created_at', '>', 'updated_at')->get();
Tip given by @iamgurmandeep