app/Api/V1/Controllers/GoodController.php
/**
     * download sample import goods excel/csv file
     */
download sample import goods excel/csv file
download sample import goods excel / csv file
public function sampleImportGoods(Request $request)
    {
        $type = $request->type;
        if (!$type) {
            return $this->withMessage('Batch upload type not valid', 400);
        }
        if ($type === 'goods') {
            return Excel::download(new GoodsUploadSample, 'goods_upload_sample_' . date('d-m-yHis') . '.xlsx');
        } else {
            return Excel::download(new PriceUploadSample, 'price_upload_sample_' . date('d-m-yHis') . '.xlsx');
        }
    }
public function sampleImportGoods ( Request $ request ) { $ type = $ request -> type ; if ( ! $ type ) { return $ this -> withMessage ( 'Batch upload type not valid' , 400 ) ; } if ( $ type === 'goods' ) { return Excel :: download ( new GoodsUploadSample , 'goods_upload_sample_' . date ( 'd-m-yHis' ) . '.xlsx' ) ; } else { return Excel :: download ( new PriceUploadSample , 'price_upload_sample_' . date ( 'd-m-yHis' ) . '.xlsx' ) ; } }
download sample import goods excel/csv file
download sample import goods excel / csv file
//        return HttpResponse::download($fileUrl);