Laravel includes Eloquent, an object-relational mapper (ORM) that makes it pleasant to interact with your database. Eloquent ORM seems like a simple mechanism, but under the hood, there’s a lot of semi-hidden functions and less-known ways to achieve more with it. In this article, I will show you some latest tips and tricks related to Laravel Eloquent and DB Models. Laravel offers helpers to query JSON columns for databases that support them.
return Task::whereColumn('created_at', 'updated_at')->get(); // pass a comparison operator return Task::whereColumn('created_at', '>', 'updated_at')->get(); Eloquent has many excellent functionalities, which I explained above.