title: laravel excel read file without import to database
body: <p>I'm using this libray to manage excel file on laravel project (<a href="https://docs.laravel-excel.com/3.1/getting-started/" rel="noreferrer">https://docs.laravel-excel.com/3.1/getting-started/</a>)</p>
  
  <p>I would like to readonly excel file once I upload in from local and return as JSON.</p>
  
  <p>My code in controller is </p>
  
  <pre><code>$excel = $request-&gt;file('excel');
  $array = Excel::import(new ProductsImport, $excel);
  </code></pre>
  
  <p>where ProductsImport file is</p>
  
  <pre><code>&lt;?php
  
  namespace App\Imports;
  
  use App\Models\Product;
  use Maatwebsite\Excel\Concerns\Importable;
  use Maatwebsite\Excel\Concerns\ToModel;
  
  class ProductsImport implements ToModel
  {
  
      use Importable;
  
      /**
       * @param array $row
       *
       * @return Products|null
       */
      public function model(array $row)
      {
  
          //return $row;
  
          return new Product([
              'name' =&gt; $row[0],
              'email' =&gt; $row[1]
          ]);
  
      }
  }
  </code></pre>