From 5025949eaa0a48fa5baec2e0126f2bceb796ac15 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Dec 2020 15:31:49 +1100 Subject: [PATCH] CSV import --- app/Jobs/Import/CSVImport.php | 74 +++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 app/Jobs/Import/CSVImport.php diff --git a/app/Jobs/Import/CSVImport.php b/app/Jobs/Import/CSVImport.php new file mode 100644 index 000000000000..49657ce0d065 --- /dev/null +++ b/app/Jobs/Import/CSVImport.php @@ -0,0 +1,74 @@ +request = $request; + + $this->company = $company; + + $this->hash = $request->input('hash'); + + $this->entity_type = $request->input('entity_type'); + + $this->skip_headers = $request->input('skip_headers'); + } + + /** + * Execute the job. + * + * + * @return void + */ + public function handle() + { + MultiDB::setDb($this->company->db); + + } + + public function failed($exception) + { + + } + + private function getCsv() + { + $base64_encoded_csv = Cache::get($this->hash); + + return base64_decode($base64_encoded_csv); + } +}