27 lines
467 B
PHP
27 lines
467 B
PHP
<?php
|
|
|
|
namespace App\Imports;
|
|
|
|
use Illuminate\Support\Collection;
|
|
use Maatwebsite\Excel\Concerns\ToCollection;
|
|
|
|
class ExcelImport implements ToCollection
|
|
{
|
|
public $rows = [];
|
|
|
|
/**
|
|
* @param Collection $collection
|
|
*/
|
|
public function collection(Collection $collection)
|
|
{
|
|
foreach($collection as $item) {
|
|
self::$rows[] = $item->toArray();
|
|
}
|
|
}
|
|
|
|
public function getRows()
|
|
{
|
|
return self::$rows;
|
|
}
|
|
}
|