2019-11-16 10:21:14 +03:00
|
|
|
<?php
|
|
|
|
|
2019-12-31 15:49:09 +03:00
|
|
|
namespace App\Imports\Purchases;
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2020-01-20 01:26:35 +03:00
|
|
|
use App\Abstracts\Import;
|
2019-11-16 10:21:14 +03:00
|
|
|
use App\Models\Common\Contact as Model;
|
|
|
|
use App\Http\Requests\Common\Contact as Request;
|
|
|
|
|
2020-01-20 01:26:35 +03:00
|
|
|
class Vendors extends Import
|
2019-11-16 10:21:14 +03:00
|
|
|
{
|
|
|
|
public function model(array $row)
|
|
|
|
{
|
|
|
|
return new Model($row);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function map($row): array
|
|
|
|
{
|
2020-01-20 11:12:14 +03:00
|
|
|
$row = parent::map($row);
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2020-01-20 11:12:14 +03:00
|
|
|
$row['type'] = 'vendor';
|
2019-11-16 10:21:14 +03:00
|
|
|
|
|
|
|
return $row;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
return (new Request())->rules();
|
|
|
|
}
|
2020-01-20 01:26:35 +03:00
|
|
|
}
|