jeudi 30 mars 2017

whereraw Vs DB::raw in Laravel

I am confused and really don't know how and where should I choose to use one from both ?

I read docs for both

http://ift.tt/2ny0L4A

And

http://ift.tt/2nOmc3I

If I use query something like this its not working

DB::table('table_name')
->where('parent_id', $parent_id)
->whereRaw("date",">",$date)
->get();

But it works

DB::table('table_name')
->where('parent_id', $parent_id)
->where(DB::raw("date",">",$date))
->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire