You can apply TIMEDIFF using this Raw Expression https://laravel.com/docs/7.x/queries#raw-expressions
\App\User::selectRaw("*, TIMEDIFF(created_at,updated_at) as diff")->first();
Or you can use carbon
I am trying to find the difference between two DateTime type columns in minutes using Laravel's query builder. I am aware of PHP's TIMEDIFF() function, however, Laravel doesn't seem to have such a function. Any ideas to replicate TIMEDIFF() in Laravel or maybe I missed it in the documentation.
Please or to participate in this conversation.