Browse Source

Edit file attachmant

Azam Rezayi 4 years ago
parent
commit
8e9ba7548a

+ 0 - 85
packages/product/src/Http/Controllers/AttachmentController.php

@@ -1,85 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use App\Attachment;
-use Illuminate\Http\Request;
-
-class AttachmentController extends Controller
-{
-    /**
-     * Display a listing of the resource.
-     *
-     * @return \Illuminate\Http\Response
-     */
-    public function index()
-    {
-        //
-    }
-
-    /**
-     * Show the form for creating a new resource.
-     *
-     * @return \Illuminate\Http\Response
-     */
-    public function create()
-    {
-        //
-    }
-
-    /**
-     * Store a newly created resource in storage.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @return \Illuminate\Http\Response
-     */
-    public function store(Request $request)
-    {
-        //
-    }
-
-    /**
-     * Display the specified resource.
-     *
-     * @param  \App\Attachment  $attachment
-     * @return \Illuminate\Http\Response
-     */
-    public function show(Attachment $attachment)
-    {
-        //
-    }
-
-    /**
-     * Show the form for editing the specified resource.
-     *
-     * @param  \App\Attachment  $attachment
-     * @return \Illuminate\Http\Response
-     */
-    public function edit(Attachment $attachment)
-    {
-        //
-    }
-
-    /**
-     * Update the specified resource in storage.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \App\Attachment  $attachment
-     * @return \Illuminate\Http\Response
-     */
-    public function update(Request $request, Attachment $attachment)
-    {
-        //
-    }
-
-    /**
-     * Remove the specified resource from storage.
-     *
-     * @param  \App\Attachment  $attachment
-     * @return \Illuminate\Http\Response
-     */
-    public function destroy(Attachment $attachment)
-    {
-        //
-    }
-}

+ 0 - 85
packages/product/src/Http/Controllers/DraftController.php

@@ -1,85 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use App\Draft;
-use Illuminate\Http\Request;
-
-class DraftController extends Controller
-{
-    /**
-     * Display a listing of the resource.
-     *
-     * @return \Illuminate\Http\Response
-     */
-    public function index()
-    {
-        //
-    }
-
-    /**
-     * Show the form for creating a new resource.
-     *
-     * @return \Illuminate\Http\Response
-     */
-    public function create()
-    {
-        //
-    }
-
-    /**
-     * Store a newly created resource in storage.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @return \Illuminate\Http\Response
-     */
-    public function store(Request $request)
-    {
-        //
-    }
-
-    /**
-     * Display the specified resource.
-     *
-     * @param  \App\Draft  $draft
-     * @return \Illuminate\Http\Response
-     */
-    public function show(Draft $draft)
-    {
-        //
-    }
-
-    /**
-     * Show the form for editing the specified resource.
-     *
-     * @param  \App\Draft  $draft
-     * @return \Illuminate\Http\Response
-     */
-    public function edit(Draft $draft)
-    {
-        //
-    }
-
-    /**
-     * Update the specified resource in storage.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \App\Draft  $draft
-     * @return \Illuminate\Http\Response
-     */
-    public function update(Request $request, Draft $draft)
-    {
-        //
-    }
-
-    /**
-     * Remove the specified resource from storage.
-     *
-     * @param  \App\Draft  $draft
-     * @return \Illuminate\Http\Response
-     */
-    public function destroy(Draft $draft)
-    {
-        //
-    }
-}

+ 22 - 74
packages/product/src/Http/Controllers/ProductController.php

@@ -21,13 +21,10 @@ use App\Models\Category;
 use App\Models\Upload;
 use App\Models\Upload;
 use phpDocumentor\Reflection\Types\Compound;
 use phpDocumentor\Reflection\Types\Compound;
 
 
-
-
 class ProductController extends Controller
 class ProductController extends Controller
 {
 {
     public function __construct()
     public function __construct()
     {
     {
-
     }
     }
 
 
 //  *******************************************show  page product ************
 //  *******************************************show  page product ************
@@ -57,23 +54,23 @@ class ProductController extends Controller
     public function create(Request $request)
     public function create(Request $request)
     {
     {
         $categories = Category::orderBy('parent_id')->where('parent_id', 0)->get();
         $categories = Category::orderBy('parent_id')->where('parent_id', 0)->get();
-        if( !$request->has('draft_id') ){
+        if (!$request->has('draft_id')) {
             $draft = new Draft();
             $draft = new Draft();
             $draft->object_type = 'Packages\Product';
             $draft->object_type = 'Packages\Product';
             $draft->save();
             $draft->save();
-            return redirect()->route('products.create',['draft_id' => $draft->id]);
-        }
-        else{
-            $draft = Draft::find( $request->draft_id );
-            if( is_null( $draft ) ){
-                return redirect()->route( 'products.create');
+            return redirect()->route('products.create', ['draft_id' => $draft->id]);
+        } else {
+            $draft = Draft::find($request->draft_id);
+            if (is_null($draft)) {
+                return redirect()->route('products.create');
             }
             }
         }
         }
         $args = [
         $args = [
-            'draft'         => $draft
+            'draft' => $draft
         ];
         ];
-        return view( 'product::product.create',$args, compact('categories')) ;
+        return view('product::product.create', $args, compact('categories'));
     }
     }
+
 // *********************************************************save products ******************
 // *********************************************************save products ******************
     public function store(ProductRequest $request)
     public function store(ProductRequest $request)
     {
     {
@@ -82,13 +79,13 @@ class ProductController extends Controller
             'sale_price' => preg_replace('/[^0-9]+/', '', $request->sale_price),
             'sale_price' => preg_replace('/[^0-9]+/', '', $request->sale_price),
         ]);
         ]);
 
 
-        if( !$request->has('draft_id') ){
+        if (!$request->has('draft_id')) {
             return abort(403, 'دسترسی به این صفحه ممکن نیست ؛ لطفا مجددا تلاش کنید.');
             return abort(403, 'دسترسی به این صفحه ممکن نیست ؛ لطفا مجددا تلاش کنید.');
         }
         }
-        $draft = Draft::findOrFail( $request->draft_id );
+        $draft = Draft::findOrFail($request->draft_id);
         $data = [
         $data = [
             'title' => $request->title,
             'title' => $request->title,
-             'slug' => $request->slug,
+            'slug' => $request->slug,
             'sku' => $request->sku,
             'sku' => $request->sku,
             'ReleaseStatus' => $request->ReleaseStatus,
             'ReleaseStatus' => $request->ReleaseStatus,
             'price' => $request->price,
             'price' => $request->price,
@@ -100,7 +97,7 @@ class ProductController extends Controller
         ];
         ];
 //        if( $draft->attachments->count() == 0 ){
 //        if( $draft->attachments->count() == 0 ){
 //            return redirect()->back()
 //            return redirect()->back()
-//                ->withErrors( ['error_message' => 'نامه باید حداقل یک ضمیمه داشته باشد.'] )
+//                ->withErrors( ['error_message' => 'حتما باید یک فایل آپلود شود.'] )
 //                ->withInput( $request->all() );
 //                ->withInput( $request->all() );
 //        }
 //        }
 //        dd($draft->attachments);
 //        dd($draft->attachments);
@@ -117,7 +114,6 @@ class ProductController extends Controller
             $diskName = 'product';
             $diskName = 'product';
             $this->uploadGallery($file, $diskName, $product, $type);
             $this->uploadGallery($file, $diskName, $product, $type);
         }
         }
-
         if ($request->has('featured_image')) {
         if ($request->has('featured_image')) {
             $info = $request->only(['featureDescription', 'featureCaption']);
             $info = $request->only(['featureDescription', 'featureCaption']);
             $file = $request->file('featured_image');
             $file = $request->file('featured_image');
@@ -125,10 +121,10 @@ class ProductController extends Controller
             $diskName = 'product';
             $diskName = 'product';
             $this->uploadFeature($file, $diskName, $product, $type, $info);
             $this->uploadFeature($file, $diskName, $product, $type, $info);
         }
         }
-
         $msg = 'ذخیره محصول با موفقیت انجام شد ';
         $msg = 'ذخیره محصول با موفقیت انجام شد ';
         return redirect(route('products.edit', $product->id))->with('success', $msg);
         return redirect(route('products.edit', $product->id))->with('success', $msg);
     }
     }
+
     // ******************************************************edit page product*********************************************
     // ******************************************************edit page product*********************************************
     public function edit(Product $product)
     public function edit(Product $product)
     {
     {
@@ -137,15 +133,12 @@ class ProductController extends Controller
     }
     }
 
 
 // *******************************************update page product*****************************************
 // *******************************************update page product*****************************************
-
     public function update(ProductRequestEdit $request, Product $product)
     public function update(ProductRequestEdit $request, Product $product)
     {
     {
-
         $request->merge([
         $request->merge([
             'price' => preg_replace('/[^0-9]+/', '', $request->price),
             'price' => preg_replace('/[^0-9]+/', '', $request->price),
             'sale_price' => preg_replace('/[^0-9]+/', '', $request->sale_price),
             'sale_price' => preg_replace('/[^0-9]+/', '', $request->sale_price),
         ]);
         ]);
-//        'categories' => $request->categories,
         $data = [
         $data = [
             'title' => $request->title,
             'title' => $request->title,
             'slug' => $request->slug,
             'slug' => $request->slug,
@@ -157,17 +150,14 @@ class ProductController extends Controller
             'status' => $request->status,
             'status' => $request->status,
             'discription' => $request->discription,
             'discription' => $request->discription,
             'creator_id' => auth()->user()->id,
             'creator_id' => auth()->user()->id,
-
         ];
         ];
         $product->update($data);
         $product->update($data);
-
         $product->categories()->sync($request->categories);
         $product->categories()->sync($request->categories);
         if ($request->has('gallery_image')) {
         if ($request->has('gallery_image')) {
             $file = $request->only('gallery_image', 'captionGallery', 'descriptionGallery');
             $file = $request->only('gallery_image', 'captionGallery', 'descriptionGallery');
             $type = 'gallery_image';
             $type = 'gallery_image';
             $diskName = 'product';
             $diskName = 'product';
             $this->updateGallery($file, $diskName, $product, $type);
             $this->updateGallery($file, $diskName, $product, $type);
-
         }
         }
         if ($request->has('featured_image')) {
         if ($request->has('featured_image')) {
             $info = $request->only(['featureDescription', 'featureCaption']);
             $info = $request->only(['featureDescription', 'featureCaption']);
@@ -175,37 +165,28 @@ class ProductController extends Controller
             $type = 'featured_image';
             $type = 'featured_image';
             $diskName = 'product';
             $diskName = 'product';
             $this->uploadFeature($file, $diskName, $product, $type, $info);
             $this->uploadFeature($file, $diskName, $product, $type, $info);
-
         }
         }
 
 
-
         $msg = 'ویرایش محصول با موفقیت انجام شد ';
         $msg = 'ویرایش محصول با موفقیت انجام شد ';
-
         return redirect(route('products.index'))->with('success', $msg);
         return redirect(route('products.index'))->with('success', $msg);
     }
     }
 
 
     //***************************** delete products*****************************************
     //***************************** delete products*****************************************
-
     public function destroy(Product $product)
     public function destroy(Product $product)
     {
     {
-
         $product->delete();
         $product->delete();
         {
         {
             return back();
             return back();
         }
         }
     }
     }
+
 //****************upload images in the product************************
 //****************upload images in the product************************
-    public function uploadFeature($file, $diskName, $product, $type,$info)
+    public function uploadFeature($file, $diskName, $product, $type, $info)
     {
     {
-
         $fileExtension = $file->getClientOriginalExtension();
         $fileExtension = $file->getClientOriginalExtension();
-
         $fileMimeType = $file->getMimeType();
         $fileMimeType = $file->getMimeType();
-
         $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
         $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
-
         $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
         $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
-
         $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
         $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
 
 
         if (File::exists($filePath)) {
         if (File::exists($filePath)) {
@@ -213,36 +194,26 @@ class ProductController extends Controller
         }
         }
 
 
         $upload = $file->storeAs($afterDiskRoot, $fileName, $diskName);
         $upload = $file->storeAs($afterDiskRoot, $fileName, $diskName);
-
-
         $uploadData = [
         $uploadData = [
             'name' => $fileName,
             'name' => $fileName,
             'path' => $upload,
             'path' => $upload,
             'mime_type' => $fileMimeType,
             'mime_type' => $fileMimeType,
             'extension' => $fileExtension,
             'extension' => $fileExtension,
-           'type' => $type,
+            'type' => $type,
             'descriptionImg' => $info['featureDescription'],
             'descriptionImg' => $info['featureDescription'],
             'caption' => $info['featureCaption'],
             'caption' => $info['featureCaption'],
-
-
         ];
         ];
 
 
-
         $uploaded = $product->uploads()->create($uploadData);
         $uploaded = $product->uploads()->create($uploadData);
 
 
-
     }
     }
 
 
-    public function updateFeature($file, $diskName, $product, $type,$info)
+    public function updateFeature($file, $diskName, $product, $type, $info)
     {
     {
         $fileExtension = $file->getClientOriginalExtension();
         $fileExtension = $file->getClientOriginalExtension();
-
         $fileMimeType = $file->getMimeType();
         $fileMimeType = $file->getMimeType();
-
         $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
         $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
-
         $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
         $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
-
         $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
         $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
 
 
         if (File::exists($filePath)) {
         if (File::exists($filePath)) {
@@ -262,25 +233,23 @@ class ProductController extends Controller
         $uploaded = $product->uploads()->update($uploadData);
         $uploaded = $product->uploads()->update($uploadData);
     }
     }
 
 
-//************************delete image in th product**********************
+//************************delete image in the product**********************
     public function destroyFile(Upload $upload)
     public function destroyFile(Upload $upload)
     {
     {
         $upload->delete();
         $upload->delete();
         $msg = 'حذف عکس محصول با موفقیت انجام شد ';
         $msg = 'حذف عکس محصول با موفقیت انجام شد ';
-        session()->flash('image_deleted',$msg);
+        session()->flash('image_deleted', $msg);
         return redirect()->back();
         return redirect()->back();
     }
     }
+
+//    ****************************uploadGallery********************
     public function uploadGallery($files, $diskName, $product, $type)
     public function uploadGallery($files, $diskName, $product, $type)
     {
     {
         foreach ($files['gallery_image'] as $key => $file) {
         foreach ($files['gallery_image'] as $key => $file) {
             $fileExtension = $file->getClientOriginalExtension();
             $fileExtension = $file->getClientOriginalExtension();
-
             $fileMimeType = $file->getMimeType();
             $fileMimeType = $file->getMimeType();
-
             $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
             $afterDiskRoot = '/' . jdate()->format('Y') . '/' . jdate()->format('m');
-
             $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
             $fileName = jdate(time())->format('Ymd') . '_' . $file->getClientOriginalName();
-
             $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
             $filePath = storage_path('app/public/' . $diskName . $afterDiskRoot . '/' . $fileName);
 
 
             if (File::exists($filePath)) {
             if (File::exists($filePath)) {
@@ -296,13 +265,10 @@ class ProductController extends Controller
                 'descriptionImg' => $files['descriptionGallery'][$key],
                 'descriptionImg' => $files['descriptionGallery'][$key],
                 'caption' => $files['captionGallery'][$key],
                 'caption' => $files['captionGallery'][$key],
             ];
             ];
-
             $uploaded = $product->uploads()->create($uploadData);
             $uploaded = $product->uploads()->create($uploadData);
         }
         }
     }
     }
 
 
-
-
     public function updateGallery($files, $diskName, $product, $type)
     public function updateGallery($files, $diskName, $product, $type)
     {
     {
         foreach ($files['gallery_image'] as $key => $file) {
         foreach ($files['gallery_image'] as $key => $file) {
@@ -327,22 +293,4 @@ class ProductController extends Controller
             $uploaded = $product->uploads()->update($uploadData);
             $uploaded = $product->uploads()->update($uploadData);
         }
         }
     }
     }
-
-//    public function SaveFormProductByAjax(Request $request)
-//    {
-//        $title = $this->input->post('title');
-//        $price = $this->input->post('price');
-//        $slug = $this->input->post('slug');
-//        $type= $this->input->post('type');
-//        $ReleaseStatus = $this->input->post('ReleaseStatus');
-//        $status = $this->input->post('status');
-//        $discription = $this->input->post('discription');
-//        $categories = $this->input->post('categories');
-//        $featured_image = $this->input->post('featured_image');
-//
-//        $data=array('title' => $title,"price" =>  $price,"slug" => $slug,"type" => $type,"status" => $status,"discription" => $discription,"categories" => $categories,"featured_image" => $featured_image,"ReleaseStatus" => $ReleaseStatus);
-//       $prouduct = Product::update($data);
-//        return $prouduct->with('success', 'اطلاعات با موفقیت ثبت شد .') ;
-//
-//    }
 }
 }

+ 5 - 15
packages/product/src/js/product.js

@@ -5,10 +5,8 @@ $(document).ready(function(){
         e.preventDefault();
         e.preventDefault();
         $(this).closest(".DeleteImages").remove();
         $(this).closest(".DeleteImages").remove();
     });
     });
-
 });
 });
 var FileUploader = (function() {
 var FileUploader = (function() {
-
     function FileUploader(options) {
     function FileUploader(options) {
         options = options || {};
         options = options || {};
 
 
@@ -17,8 +15,6 @@ var FileUploader = (function() {
         this.input = this.widget.querySelector('.files');
         this.input = this.widget.querySelector('.files');
         this.output = this.widget.querySelector('.list');
         this.output = this.widget.querySelector('.list');
     };
     };
-
-
     FileUploader.prototype.init = function() {
     FileUploader.prototype.init = function() {
         var self = this;
         var self = this;
 
 
@@ -26,8 +22,6 @@ var FileUploader = (function() {
         self.input.addEventListener('change', function(e) {self.handleFile(e, self);}, false);
         self.input.addEventListener('change', function(e) {self.handleFile(e, self);}, false);
         self.dropZone.addEventListener('dragover', self.handleDragOver, false);
         self.dropZone.addEventListener('dragover', self.handleDragOver, false);
     };
     };
-
-    //
     FileUploader.prototype.handleFile = function(evt, that) {
     FileUploader.prototype.handleFile = function(evt, that) {
         var self = that;
         var self = that;
         var files;
         var files;
@@ -43,19 +37,14 @@ var FileUploader = (function() {
 
 
         self.selectLogic(files, self);
         self.selectLogic(files, self);
     };
     };
-
-
     FileUploader.prototype.handleDragOver = function(evt) {
     FileUploader.prototype.handleDragOver = function(evt) {
         evt.stopPropagation();
         evt.stopPropagation();
         evt.preventDefault();
         evt.preventDefault();
         evt.dataTransfer.dropEffect = 'link';
         evt.dataTransfer.dropEffect = 'link';
     };
     };
-
-
     FileUploader.prototype.selectLogic = function(files, that) {
     FileUploader.prototype.selectLogic = function(files, that) {
         var self = that;
         var self = that;
         var reader;
         var reader;
-
         for (var i = 0, file; file = files[i]; i++) {
         for (var i = 0, file; file = files[i]; i++) {
 
 
             reader = new FileReader();
             reader = new FileReader();
@@ -108,9 +97,10 @@ var FileUploader = (function() {
     return FileUploader;
     return FileUploader;
 })();
 })();
 
 
-var test = new FileUploader({className: '.test'});
-test.init();
-
+    if( $('.GalleryImageChoice').length > 0 ){
+        var GalleryImageChoice = new FileUploader({className: '.GalleryImageChoice'});
+        GalleryImageChoice.init();
+    }
 //***************FEATURE IMAGES***************************************
 //***************FEATURE IMAGES***************************************
 $(document).ready(function () {
 $(document).ready(function () {
     $('[data-toggle="tooltip"]').tooltip({
     $('[data-toggle="tooltip"]').tooltip({
@@ -314,4 +304,4 @@ $(document).ready(function () {
         };
         };
     }
     }
 });
 });
-
+//    ********************File Attachment*******************

+ 1 - 1
packages/product/src/sass/product.scss

@@ -109,7 +109,7 @@ output span{
     text-align: center;
     text-align: center;
 }
 }
 
 
-.test{
+.GalleryImageChoice{
     padding: 10px;
     padding: 10px;
 }
 }
 .DeleteImages{
 .DeleteImages{

+ 5 - 4
packages/product/src/views/product/create.blade.php

@@ -23,7 +23,7 @@
                             @component('product::components.message')
                             @component('product::components.message')
                             @endcomponent
                             @endcomponent
                             <div class="card-body mx-lg-5 px-lg-3">
                             <div class="card-body mx-lg-5 px-lg-3">
-                                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" id="DraftProduct">
+                                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
                                     @csrf
                                     @csrf
                                     <input type="hidden" name="draft_id" value="{{ $draft->id }}">
                                     <input type="hidden" name="draft_id" value="{{ $draft->id }}">
                                     <div class="form-group">
                                     <div class="form-group">
@@ -104,9 +104,9 @@
                                         <div class="form-group col-lg-4">
                                         <div class="form-group col-lg-4">
                                             <label for="status">{{ __('product.ReleaseStatus') }}</label><i class="required">&nbsp; *</i>
                                             <label for="status">{{ __('product.ReleaseStatus') }}</label><i class="required">&nbsp; *</i>
                                             <select id="ReleaseStatus" type="text" class="form-control @error('ReleaseStatus') is-invalid @enderror" name="ReleaseStatus"  value="{{ old('ReleaseStatus') }}" autocomplete="ReleaseStatus">
                                             <select id="ReleaseStatus" type="text" class="form-control @error('ReleaseStatus') is-invalid @enderror" name="ReleaseStatus"  value="{{ old('ReleaseStatus') }}" autocomplete="ReleaseStatus">
-                                                <option value="">انتخاب کنید</option>
+{{--                                                <option value="">انتخاب کنید</option>--}}
                                                 <option value="draft" {{ (old('ReleaseStatus') == 'draft') ? 'selected' : '' }}>پیشنویس</option>
                                                 <option value="draft" {{ (old('ReleaseStatus') == 'draft') ? 'selected' : '' }}>پیشنویس</option>
-                                                <option value="pending" {{ (old('ReleaseStatus') == 'pending') ? 'selected' : '' }}>در حال انتظار</option>
+                                                <option value="pending" {{ (old('ReleaseStatus') == 'pending') ? 'selected' : '' }}>در انتظار انتشار</option>
                                                 <option value="published" {{ (old('ReleaseStatus') == 'published') ? 'selected' : '' }}>منتشر شده</option>
                                                 <option value="published" {{ (old('ReleaseStatus') == 'published') ? 'selected' : '' }}>منتشر شده</option>
                                             </select>
                                             </select>
                                             @error('ReleaseStatus')
                                             @error('ReleaseStatus')
@@ -172,7 +172,7 @@
                                         @enderror
                                         @enderror
                                     </div>
                                     </div>
                                     <div class="form-row ">
                                     <div class="form-row ">
-                                        <div class="upload-widget test ">
+                                        <div class="upload-widget GalleryImageChoice ">
                                             <div class="select">
                                             <div class="select">
                                                 <span class="btn btn-primary btn-file">
                                                 <span class="btn btn-primary btn-file">
                                                     <input class="files" type="file" name="gallery_image[]" value="{{old('gallery_image[]')}}" multiple>
                                                     <input class="files" type="file" name="gallery_image[]" value="{{old('gallery_image[]')}}" multiple>
@@ -187,6 +187,7 @@
                                             </div>
                                             </div>
                                         </div>
                                         </div>
                                     </div>
                                     </div>
+
                                     <div class="form-group mb-0">
                                     <div class="form-group mb-0">
                                         <div class="">
                                         <div class="">
                                             <button type="submit" class="btn btn-primary" >
                                             <button type="submit" class="btn btn-primary" >

+ 1 - 1
packages/product/src/views/product/edit.blade.php

@@ -175,7 +175,7 @@
                                     </div>
                                     </div>
                                     <div class="row">
                                     <div class="row">
                                         <div class="form-row ">
                                         <div class="form-row ">
-                                            <div class="upload-widget test ">
+                                            <div class="upload-widget GalleryImageChoice ">
                                                 <div class="select">
                                                 <div class="select">
                                                     <label for="title">
                                                     <label for="title">
                                                         {{ __('product.gallery_image') }}
                                                         {{ __('product.gallery_image') }}