-1

I am trying to find count of gender using the raw statement but i get this error

Parse error: syntax error, unexpected '$total' (T_VARIABLE). Can someone please tell me whats my error

$collection='{gender:"Male"}'                    
$total = DB::collection('leads')->raw(function($collection)
{
    return $collection->find();
});
return  $total;
EddyTheDove
  • 12,979
  • 2
  • 37
  • 45
  • Possible duplicate of [PHP Parse/Syntax Errors; and How to solve them?](http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – Funk Forty Niner Mar 15 '17 at 14:50

1 Answers1

1

A semicolon is missing behind $collection='{gender:"Male"}'. (that should at least solve the error you get currently)

Tek
  • 489
  • 3
  • 13