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