mardi 18 octobre 2016

Rewrite DB::raw() query to simple DB::table()

I have a "DB::raw()" query in Laravel 5.3.

One of "WHERE" clauses is "AND TIMESTAMPDIFF(YEAR, profiles.dob, CURDATE()) >= '$min_age'". Here I'm checking if user's year of birth is greater or equal to a certain number (user age).

How can I rewrite this clause using "DB::table()" without "DB::raw()", if possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire