this makes possible adding extra attributes to models

This commit is contained in:
Sevan Nerse
2021-02-26 15:38:45 +03:00
parent 19093668ec
commit 962e626c9e
16 changed files with 139 additions and 43 deletions

View File

@ -3,14 +3,19 @@
namespace App\Imports\Sales;
use App\Abstracts\Import;
use App\Models\Common\Contact as Model;
use App\Events\Common\ModelCreated;
use App\Http\Requests\Common\Contact as Request;
use App\Models\Common\Contact as Model;
class Customers extends Import
{
public function model(array $row)
{
return new Model($row);
$model = new Model($row);
event(new ModelCreated($model, $row));
return $model;
}
public function map($row): array