Matt Matt - 4 months ago 17
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.


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