Fix zip file extraction

This commit is contained in:
Amanmyrat 2023-08-04 14:18:16 +05:00
parent 67b594899a
commit 11988d61ca
2 changed files with 4 additions and 4 deletions

View File

@ -50,8 +50,8 @@ class Report extends Controller
$report_detail = new ReportDetail(); $report_detail = new ReportDetail();
$report_detail->report_id = $id; $report_detail->report_id = $id;
$report_detail->shop_id = $shop->id; $report_detail->shop_id = $shop->id;
// on local explode storage\app on live server storage/app // on local explode storage\app on live server storage/app
$report_detail->file = explode('storage/app', $storageDestinationPath)[1].'/'.$item; $report_detail->file = '/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item;
$report_detail->save(); $report_detail->save();
Log::info("saved succesfully"); Log::info("saved succesfully");
}else { }else {

View File

@ -36,10 +36,10 @@ class ReportDetail extends Model
]; ];
public function getShopFieldAttribute() { public function getShopFieldAttribute() {
return $this->shop->name; return $this->shop != null ? $this->shop->name : '';
} }
public function getReportFieldAttribute() { public function getReportFieldAttribute() {
return $this->report->name; return $this->report != null ? $this->report->name : '';
} }
} }