[WIP] Import Plans
This commit is contained in:
32
app/Imports/PlansImport.php
Normal file
32
app/Imports/PlansImport.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Imports;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||
use Maatwebsite\Excel\Concerns\ToArray;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
|
||||
class PlansImport implements ToArray, WithHeadingRow
|
||||
{
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
// public function collection(Collection $collection)
|
||||
// {
|
||||
// foreach ($collection as $row)
|
||||
// {
|
||||
// User::create([
|
||||
// 'name' => $row[0],
|
||||
// ]);
|
||||
// }
|
||||
// }
|
||||
|
||||
public function array($row)
|
||||
{
|
||||
return [
|
||||
// 'first' => $row[0],
|
||||
// 'kajsdnkjasnd' => 'henlo'
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user