update
parent
8f86378bfe
commit
715c0ac556
|
|
@ -52,10 +52,8 @@ class DatasetRepository implements DatasetRepositoryInterface
|
||||||
throw new \Exception("Import {$importClass} tidak ditemukan");
|
throw new \Exception("Import {$importClass} tidak ditemukan");
|
||||||
}
|
}
|
||||||
|
|
||||||
// dd($data);
|
try {
|
||||||
return DB::transaction(function () use ($modelClass, $importClass, $file, $data) {
|
DB::transaction(function () use ($modelClass, $importClass, $file, $data) {
|
||||||
|
|
||||||
try {
|
|
||||||
$keyId = decode_id($data['secure_id']);
|
$keyId = decode_id($data['secure_id']);
|
||||||
$json = [];
|
$json = [];
|
||||||
$filePath = null;
|
$filePath = null;
|
||||||
|
|
@ -167,24 +165,22 @@ class DatasetRepository implements DatasetRepositoryInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
return $masterModel;
|
return $masterModel;
|
||||||
}catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
|
});
|
||||||
$failures = $e->failures();
|
}catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
|
||||||
|
$failures = $e->failures();
|
||||||
|
|
||||||
foreach ($failures as $failure) {
|
foreach ($failures as $failure) {
|
||||||
// Kolom & baris error
|
// Kolom & baris error
|
||||||
dump('Row: '.$failure->row());
|
dump('Row: '.$failure->row());
|
||||||
dump('Attribute: '.$failure->attribute());
|
dump('Attribute: '.$failure->attribute());
|
||||||
dump('Errors: ', $failure->errors());
|
dump('Errors: ', $failure->errors());
|
||||||
dump('Values: ', $failure->values());
|
dump('Values: ', $failure->values());
|
||||||
}
|
|
||||||
|
|
||||||
return $failures;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
dd($e->getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $failures;
|
||||||
});
|
} catch (Exception $e) {
|
||||||
|
dd($e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getChartData($modelClass,$datasetId,$templateId)
|
public function getChartData($modelClass,$datasetId,$templateId)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue