Item import re-factoring for multiple tax feature

This commit is contained in:
Cüneyt Şentürk
2020-12-21 11:24:38 +03:00
parent 4008eb6444
commit b9fe48d746
3 changed files with 72 additions and 21 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace App\Imports\Common\Sheets;
use App\Abstracts\Import;
use App\Http\Requests\Common\Item as Request;
use App\Models\Common\Item as Model;
class Items extends Import
{
public function model(array $row)
{
return new Model($row);
}
public function map($row): array
{
$row = parent::map($row);
$row['category_id'] = $this->getCategoryId($row, 'item');
return $row;
}
public function rules(): array
{
return (new Request())->rules();
}
}