diff --git a/app/Http/Controllers/PrintPatternController.php b/app/Http/Controllers/PrintPatternController.php
index 3a5610c..8dd9956 100644
--- a/app/Http/Controllers/PrintPatternController.php
+++ b/app/Http/Controllers/PrintPatternController.php
@@ -5,6 +5,7 @@ use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request1;
use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Storage;
use App\Models\PrintPatternModel;
use App\Models\SizesModel;
@@ -46,7 +47,7 @@ class PrintPatternController extends Controller {
$NewImageName = $templateSize.'.'.$imageExt;
- $thumbnail = "uniform-templates/".$templatecode."/".$templateType."/SIZES/" . $NewImageName;
+ $thumbnail = "uploads/images/uniform-templates/".$templatecode."/".$templateType."/SIZES/" . $NewImageName;
$data = array(
'TemplateCode' => $templatecode,
@@ -58,9 +59,7 @@ class PrintPatternController extends Controller {
$i = $m->insertPrintPattern($data);
//var_dump($data);
if($i){
- $r = $request->file('preview_print_template')->move(
- base_path() . "/public/images/uniform-templates/".$templatecode."/".$templateType."/SIZES/", $NewImageName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templatecode.'/'.$templateType.'/SIZES/'.$NewImageName, file_get_contents($request->file('preview_print_template')->getRealPath()));
echo '
-
Thumbnail ?>" alt="Sports" height="400px;" class="img img-responsive product-center" />
+
@@ -129,15 +130,13 @@ class TemplatesController extends Controller {
if($i){
- $request->file('tempateImage')->move(
- base_path() . '/public/images/templates/thumbnail', $NewImageName
- );
+ Storage::disk('minio')->put('images/templates/thumbnail/' . $NewImageName, file_get_contents($request->file('tempateImage')->getRealPath()));
//for front jersey
if(!empty($request->file('svgJerseyFront')->getClientOriginalName())){
$svgName = $request->file('svgJerseyFront')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
//var_dump($svgThumbnail);
$Templatedata = array(
'TemplateCode' => $templateCode,
@@ -149,16 +148,14 @@ class TemplatesController extends Controller {
$i = $m->insertTempaltePaths($Templatedata);
if($i){
- $request->file('svgJerseyFront')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgJerseyFront')->getRealPath()));
}
}
if(!empty($request->file('svgJerseyBack')->getClientOriginalName())){
$svgName = $request->file('svgJerseyBack')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
@@ -170,16 +167,14 @@ class TemplatesController extends Controller {
$i = $m->insertTempaltePaths($Templatedata);
if($i){
- $request->file('svgJerseyBack')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgJerseyBack')->getRealPath()));
}
}
if(!empty($request->file('svgShortRight')->getClientOriginalName())){
$svgName = $request->file('svgShortRight')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
@@ -191,16 +186,14 @@ class TemplatesController extends Controller {
$i = $m->insertTempaltePaths($Templatedata);
if($i){
- $request->file('svgShortRight')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgShortRight')->getRealPath()));
}
}
if(!empty($request->file('svgShortLeft')->getClientOriginalName())){
$svgName = $request->file('svgShortLeft')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
@@ -212,9 +205,7 @@ class TemplatesController extends Controller {
$i = $m->insertTempaltePaths($Templatedata);
if($i){
- $request->file('svgShortLeft')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgShortLeft')->getRealPath()));
}
}
@@ -270,9 +261,7 @@ class TemplatesController extends Controller {
'PatternId' => $getSkins
);
- $request->file('tempateImage')->move(
- base_path() . '/public/images/templates/thumbnail', $NewImageName
- );
+ Storage::disk('minio')->put('images/templates/thumbnail/' . $NewImageName, file_get_contents($request->file('tempateImage')->getRealPath()));
}else{
@@ -298,7 +287,7 @@ class TemplatesController extends Controller {
//echo 'meron jerset front';
$svgName = $request->file('svgJerseyFront')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Jersey',
@@ -308,9 +297,7 @@ class TemplatesController extends Controller {
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgJerseyFront']);
if($i){
- $request->file('svgJerseyFront')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgJerseyFront')->getRealPath()));
//echo 'image move success';
}
}
@@ -318,7 +305,7 @@ class TemplatesController extends Controller {
if (array_key_exists('svgJerseyBack', $post)) {
$svgName = $request->file('svgJerseyBack')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Jersey',
@@ -327,16 +314,13 @@ class TemplatesController extends Controller {
);
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgJerseyBack']);
if($i){
-
- $request->file('svgJerseyBack')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgJerseyBack')->getRealPath()));
}
}
if (array_key_exists('svgShortRight', $post)) {
$svgName = $request->file('svgShortRight')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Shorts',
@@ -346,15 +330,13 @@ class TemplatesController extends Controller {
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgShortRight']);
if($i){
- $request->file('svgShortRight')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgShortRight')->getRealPath()));
}
}
if (array_key_exists('svgShortLeft', $post)) {
$svgName = $request->file('svgShortLeft')->getClientOriginalName();
- $svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
+ $svgThumbnail = "uploads/images/uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Shorts',
@@ -364,9 +346,7 @@ class TemplatesController extends Controller {
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgShortLeft']);
if($i){
- $request->file('svgShortLeft')->move(
- base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
- );
+ Storage::disk('minio')->put('uploads/images/uniform-templates/'.$templateCode.'/DISPLAY/'.$svgName, file_get_contents($request->file('svgShortLeft')->getRealPath()));
}
}