Home > Software engineering >  How to add DATE_ADD in query on laravel
How to add DATE_ADD in query on laravel

Time:05-21

I have such a query

SELECT DATE_ADD(do, INTERVAL 1 DAY)  AS od from termin

and I want to convert them to query in Eloquent

$tab = DB::table('termin')->get 

how to do it Thank you for your help

CodePudding user response:

You can convert your query as like below.

$tab = DB::table('termin')->selectRaw('DATE_ADD(do, INTERVAL 1 DAY)  AS od')->get();
  • Related