added prefix to source

This commit is contained in:
Denis Duliçi
2021-09-10 00:31:39 +03:00
parent 640cafb133
commit 2b680f0f8e
27 changed files with 227 additions and 29 deletions

View File

@ -3,6 +3,7 @@
namespace App\Abstracts;
use App\Traits\Import as ImportHelper;
use App\Traits\Sources;
use App\Utilities\Date;
use Carbon\Exceptions\InvalidFormatException;
use Illuminate\Contracts\Queue\ShouldQueue;
@ -10,7 +11,6 @@ use Illuminate\Contracts\Translation\HasLocalePreference;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\SkipsEmptyRows;
use Maatwebsite\Excel\Concerns\ToModel;
@ -23,7 +23,7 @@ use PhpOffice\PhpSpreadsheet\Shared\Date as ExcelDate;
abstract class Import implements HasLocalePreference, ShouldQueue, SkipsEmptyRows, WithChunkReading, WithHeadingRow, WithLimit, WithMapping, WithValidation, ToModel
{
use Importable, ImportHelper;
use Importable, ImportHelper, Sources;
public $user;
@ -36,7 +36,7 @@ abstract class Import implements HasLocalePreference, ShouldQueue, SkipsEmptyRow
{
$row['company_id'] = company_id();
$row['created_by'] = $this->user->id;
$row['created_from'] = 'import';
$row['created_from'] = $this->getSourcePrefix() . 'import';
// Make enabled field integer
if (isset($row['enabled'])) {