title: How to use count number of rows and print value in view file laravel 5.4?
body: <p>app/http/controller/FirstController.php</p>
  
  <pre><code>public function delhi_property()
  {
      $sql = DB::table('property')-&gt;where('city', 'Delhi')-&gt;orWhere('city', 'New Delhi')-&gt;get();
      return view('index',['results'=&gt;$sql]);
  }
  </code></pre>
  
  <p>resources/views/index.blade.php</p>
  
  <pre><code>&lt;h3&gt;({{ $results-&gt;count() }}) Properties&lt;/h3&gt;
  </code></pre>
  
  <p>routes/web.php</p>
  
  <pre><code>Route::get('/','FirstController@delhi_property');
  </code></pre>
  
  <p>I am new in laravel 5.4 Here, what am I doing I simply run a query as I mention above in my <code>Controller</code> and want to print numbers of rows in my view file but when I check it shows an error i.e. </p>
  
  <p><code>Undefined variable: result (View: D:\xampp\htdocs\real_estate\resources\views\index.blade.php)</code></p>
  
  <p>So how can I solve this problem? Please help me.</p>