title: Laravel/Lumen API print array of records
body: <p>Is it possible to make an API which prints database records like this: <code>http://localhost:8000/products/?compare=1-2-N...(1,2,N) product id's.</code> I have succeeded printing only one record. My route:</p>
  
  <pre><code>$router-&gt;get('products/{id}','ProductController@getProduct');
  </code></pre>
  
  <p>and my controller:</p>
  
  <pre><code>public function getProduct($id){
  
          $tlt_products = DB::table('tlt_products')-&gt;find($id);
          $tlt_products_features_id = DB::table('tlt_product_features')-&gt;where('product_id', $id)-&gt;get()-&gt;pluck('feature_id');
          $tlt_features = DB::table('tlt_features')-&gt;whereIn('id', $tlt_products_features_id)-&gt;get()-&gt;groupBy('feature_group');
          $tlt_feature_groups =  DB::table('tlt_features')-&gt;groupBy('feature_group')-&gt;get()-&gt;toArray();
  
          return response()-&gt;json([
              'product' =&gt; $tlt_products,
              'product_features' =&gt; $tlt_features,
              'feature_groups' =&gt; $tlt_feature_groups
          ]);
  
      }
  </code></pre>
  
  <p>could you please help me printing array of records using route like this:</p>
  
  <pre><code>http://localhost:8000/products/?compare=1-2-3...-N
  </code></pre>