Matt Matt - 5 months ago 30
SQL Question

CURDATE() with laravel 5


I'm new to laravel and i am wanting to use multiple where clauses and use curdate().


This is an example :

$data = DB::table('toutcome')->where('date', '>=', curdate())->where('Status', '=', 'A')->count('AppID');

return view('home', compact('data'));


It's not working at all.

Answer

Change where('date', '>=', curdate()) to whereRaw('date >= curdate()')

Comments