title: Searching database content : laravel
body: <pre><code>public function scopeSearchByKeyword($query, $keyword)
  {
      if ($keyword!='') {
          $query-&gt;where(function ($query) use ($keyword) {
              $query-&gt;where("name", "LIKE","%$keyword%")
                  -&gt;orWhere("email", "LIKE", "%$keyword%")
                  -&gt;orWhere("blood_group", "LIKE", "%$keyword%")
                  -&gt;orWhere("phone", "LIKE", "%$keyword%");
          });
      }
      return $query;
  }
  </code></pre>
  
  <p>What is '$query' parameter used for? Also what does function($query) use ($keyword){} mean?</p>
  
  <pre><code>$keyword = Input::get('keyword', '');
  $users = User::SearchByKeyword($keyword)-&gt;get();
  </code></pre>
  
  <p>Why is it only 'SearchByKeyword' and not scopeSearchByKeyword? </p>