Browse Source

create page variable and incloud Attribute

Azam Rezayi 4 years ago
parent
commit
7d695ad22c

+ 0 - 0
packages/product/src/Http/Controllers/ProductControllerCop.php → azam/ProductControllerCop.php


+ 0 - 0
packages/product/src/Http/Requests/ProductRequestCopy.php → azam/ProductRequestCopy.php


+ 1 - 1
packages/product/src/views/product/createCopy.blade.php → azam/createCopy.blade.php

@@ -20,7 +20,7 @@
                             <div class="card-header">
                             <div class="card-header">
                                 <strong>{{ __('ثبت محصول جدید') }}</strong>
                                 <strong>{{ __('ثبت محصول جدید') }}</strong>
                             </div>
                             </div>
-                            @component('product::components.message')
+                            @component('product::packages.product.src.views.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" >
                                 <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >

+ 86 - 0
packages/product/src/Http/Controllers/AttributeController.php

@@ -0,0 +1,86 @@
+<?php
+
+namespace Packages\Product\Http\Controllers;
+use App\Http\Controllers\Controller;
+use Packages\Product\Models\Attribute;
+use Illuminate\Http\Request;
+
+class AttributeController 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()
+    {
+       return view('product::attributes.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\Attribute  $attribute
+     * @return \Illuminate\Http\Response
+     */
+    public function show(Attribute $attribute)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\Attribute  $attribute
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(Attribute $attribute)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\Attribute  $attribute
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, Attribute $attribute)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\Attribute  $attribute
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(Attribute $attribute)
+    {
+        //
+    }
+}

+ 2 - 4
packages/product/src/Http/Controllers/ProductController.php

@@ -51,9 +51,8 @@ class ProductController extends Controller
 //**************************************************** page create products *****************
 //**************************************************** page create products *****************
     public function create(Request $request)
     public function create(Request $request)
     {
     {
-        return view('product::product.create');
+        return view('product::product.variableProduct');
     }
     }
-
 // *********************************************************save products ******************
 // *********************************************************save products ******************
     public function store(Request $request)
     public function store(Request $request)
     {
     {
@@ -69,8 +68,7 @@ class ProductController extends Controller
         ];
         ];
         $product = Product::create($data);
         $product = Product::create($data);
         if ( 'type'=== 0){
         if ( 'type'=== 0){
-            $msg = 'ذخیره محصول با موفقیت انجام شد ';
-            return redirect(route('products.index', $product->id))->with('success', $msg);
+            return redirect(route('products.SimpleProduct', $product->id))->with('success', $msg);
         }
         }
         $msg = 'ذخیره محصول با موفقیت انجام شد ';
         $msg = 'ذخیره محصول با موفقیت انجام شد ';
         return redirect(route('products.index', $product->id))->with('success', $msg);
         return redirect(route('products.index', $product->id))->with('success', $msg);

+ 10 - 1
packages/product/src/Http/Requests/ProductRequest.php

@@ -15,6 +15,7 @@ class ProductRequest extends FormRequest
     {
     {
         return true;
         return true;
     }
     }
+
     /**
     /**
      * Get the validation rules that apply to the request.
      * Get the validation rules that apply to the request.
      *
      *
@@ -22,12 +23,20 @@ class ProductRequest extends FormRequest
      */
      */
     public function rules()
     public function rules()
     {
     {
+//        dd(request()->all());
         return [
         return [
             'title' => ['required','max:100'],
             'title' => ['required','max:100'],
+            'price' => ['required'],
             'slug' => ['unique:products'],
             'slug' => ['unique:products'],
             'type' => ['required'],
             'type' => ['required'],
-            'ReleaseStatus' => ['nullable'],
+            'status' => ['required'],
             'discription' => ['required'],
             'discription' => ['required'],
+            'categories' => ['required'],
+
+
+
         ];
         ];
+
     }
     }
+
 }
 }

+ 11 - 0
packages/product/src/Models/Attribute.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace Packages\Product\Models;
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Illuminate\Database\Eloquent\Model;
+
+class Attribute extends Model
+{
+    use SoftDeletes;
+    protected $fillable=['title', 'key', 'use_in_veriation'];
+}

+ 35 - 0
packages/product/src/database/migrations/2020_08_10_070909_create_attributes_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateAttributesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('attributes', function (Blueprint $table) {
+            $table->id();
+            $table->string('title');
+            $table->boolean('use_in_veriation')->unique()->default(true);
+            $table->string('key');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('attributes');
+    }
+}

+ 8 - 0
packages/product/src/routes/web.php

@@ -10,6 +10,14 @@ Route::group([
     Route::post('product_uploads/GalleryImage', 'ProductController@uploadGallery')->name('GalleryImage');
     Route::post('product_uploads/GalleryImage', 'ProductController@uploadGallery')->name('GalleryImage');
 
 
 });
 });
+Route::group([
+    'namespace' => 'Packages\Product\Http\Controllers',
+    'middleware' => ['web', 'auth', 'verified'],
+    'prefix' => 'panel'
+], function () {
+    Route::resource('attributes', 'AttributeController');
+
+});
 
 
 
 
 
 

+ 8 - 2
packages/product/src/sass/product.scss

@@ -111,7 +111,7 @@ output span {
 }
 }
 .form-control {
 .form-control {
     background-color: hsl(315, 22%, 86%);
     background-color: hsl(315, 22%, 86%);
-    height: calc(2.3em + 1rem + 5px);
+    height: calc(2em + .75rem + 5px);
 }
 }
 .required {
 .required {
     color: red;
     color: red;
@@ -135,4 +135,10 @@ output span {
 .message {
 .message {
     margin: auto;
     margin: auto;
 }
 }
-
+.btn_create{
+    margin: 30px ;
+    height: 3em ;
+}
+.card {
+    margin-bottom: 15px;
+}

+ 85 - 0
packages/product/src/views/attributes/create.blade.php

@@ -0,0 +1,85 @@
+@component('panel.layouts.component', ['title' => 'ثبت ویژگی های محصول'])
+
+    @slot('style')
+
+    @endslot
+    @slot('subject')
+        <h1><i class="fa fa-users"></i> ثبت ویژگی های محصول  </h1>
+        <p>ثبت ویژگی های محصول در فروشگاه.</p>
+    @endslot
+    @slot('breadcrumb')
+        <li class="breadcrumb-item"> ویژگی های محصول</li>
+    @endslot
+
+    @slot('content')
+        <div class="auth-background h-auto py-5">
+            <div class="container py-5">
+                <div class="row align-items-center ">
+                    <div class="col-lg-12 col-md-12 mx-auto">
+                        <div class="card">
+                            <div class="card-header">
+                                <strong>{{ __('ثبت محصول جدید') }}</strong>
+                            </div>
+                            @component('product::components.message')
+                            @endcomponent
+                            <div class="card-body mx-lg-5 px-lg-3">
+                                <form method="POST" action="{{ route('attributes.store') }}" enctype="multipart/form-data" >
+                                    @csrf
+                                    <div class="form-group">
+                                         <label for="title">{{ __('attribute.title') }}</label><i class="required">&nbsp; *</i>
+                                         <input id="title" type="text" class="form-control @error('title') is-invalid @enderror" name="title" value="{{ old('title') }}" autocomplete="title" autofocus>
+                                         @error('title')
+                                                <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                        @enderror
+                                    </div>
+                                    <div class="form-row">
+                                        <div class="form-group col-lg-6">
+                                            <label for="key">{{ __('attribute.key') }}</label>
+                                            <input type="text" name="key" class="form-control @error('key') is-invalid  @enderror" value="{{old('key')}}" autocomplete="key" autofocus>
+                                            @error('key')
+                                                <div class="alert alert-danger">{{$message}}</div>
+                                            @enderror
+                                        </div>
+
+
+                                        <div class="form-group col-lg-6">
+                                            <label for="use_in_veriation">{{ __('attribute.use_in_veriation') }}</label>
+                                            <select id="type" type="text" class="form-control @error('use_in_veriation') is-invalid @enderror" name="type" value="{{ old('use_in_veriation') }}" autocomplete="use_in_veriation">
+                                                <option value="1" {{ (old('use_in_veriation') === true) ? 'selected' : '' }}>بله</option>
+                                                <option value="0" {{ (old('use_in_veriation') === false) ? 'selected' : '' }}>خیر</option>
+
+                                            </select>
+                                            @error('use_in_veriation')
+                                            <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                            @enderror
+                                        </div>
+                                        </div>
+                                    <div class="form-group mb-0">
+                                        <div class="">
+                                            <button type="submit" class="btn btn-primary" >
+                                                {{ __('ثبت محصول') }}
+                                            </button>
+                                            <a href="{{ route('attributes.index') }}" type="button" class="btn btn-warning" > انصراف</a>
+                                        </div>
+                                    </div>
+                                </form>
+                            </div>
+                            <div class="card-footer">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    @endslot
+
+    @slot('script')
+
+    @endslot
+
+@endcomponent
+

+ 0 - 124
packages/product/src/views/product/SimpleProduct.blade.php

@@ -1,124 +0,0 @@
-@component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])
-
-    @slot('style')
-
-    @endslot
-    @slot('subject')
-        <h1><i class="fa fa-users"></i> ثبت محصول جدید </h1>
-        <p>ثبت محصول جدید در فروشگاه.</p>
-    @endslot
-    @slot('breadcrumb')
-        <li class="breadcrumb-item">محصولات</li>
-    @endslot
-
-    @slot('content')
-        <div class="auth-background h-auto py-5">
-            <div class="container py-5">
-                <div class="row align-items-center ">
-                    <div class="col-lg-12 col-md-12 mx-auto">
-                        <div class="card">
-                            <div class="card-header">
-                                <strong>{{ __('ثبت محصول جدید') }}</strong>
-                            </div>
-                            @component('product::components.message')
-                            @endcomponent
-                            <div class="card-body mx-lg-5 px-lg-3">
-                                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
-                                    @csrf
-                                    <div class="form-group">
-                                         <label for="title">{{ __('product.title') }}</label><i class="required">&nbsp; *</i>
-                                         <input id="title" type="text" class="form-control @error('title') is-invalid @enderror" name="title" value="{{ old('title') }}" autocomplete="title" autofocus>
-                                         @error('title')
-                                                <span class="invalid-feedback" role="alert">
-                                                    <strong>{{ $message }}</strong>
-                                                </span>
-                                        @enderror
-                                    </div>
-
-                                    <div class="form-row">
-                                        <div class="form-group col-lg-4">
-                                            <label for="slug">{{ __('product.slug') }}</label>
-                                            <input type="text" name="slug" class="form-control @error('slug') is-invalid  @enderror" value="{{old('slug')}}" autocomplete="slug" autofocus>
-                                            @error('slug')
-                                                <div class="alert alert-danger">{{$message}}</div>
-                                            @enderror
-                                        </div>
-                                        <div class="form-group col-lg-4">
-                                            <label for="sku">{{ __('product.sku') }}</label>
-                                            <input id="sku" type="text" class="form-control @error('sku') is-invalid @enderror" name="sku"
-                                                   autocomplete="sku" value="{{ old('sku') }}" autofocus>
-                                            @error('sku')
-                                                <span class="invalid-feedback" role="alert">
-                                                     <strong>{{ $message }}</strong>
-                                                 </span>
-                                            @enderror
-                                        </div>
-                                        <div class="form-group col-lg-4">
-                                            <label for="type">{{ __('product.type') }}</label></label><i class="required"> *</i>
-                                            <select id="type" type="text" class="form-control @error('type') is-invalid @enderror" name="type" value="{{ old('type') }}" autocomplete="type">
-                                                <option value="">انتخاب کنید</option>
-                                                <option value="0" {{ (old('type') == '0') ? 'selected' : '' }}>ساده</option>
-                                                <option value="1" {{ (old('type') == '1') ? 'selected' : '' }}>متغیر</option>
-                                                <option value="2" {{ (old('type') == '2') ? 'selected' : '' }}>باندل</option>
-                                            </select>
-                                            @error('type')
-                                                <span class="invalid-feedback" role="alert">
-                                                    <strong>{{ $message }}</strong>
-                                                </span>
-                                            @enderror
-                                        </div>
-                                    </div>
-
-                                        <div class="form-group col-lg-4">
-                                            <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">
-
-                                                <option value="draft" {{ (old('ReleaseStatus') == 'draft') ? 'selected' : '' }}>پیشنویس</option>
-                                                <option value="pending" {{ (old('ReleaseStatus') == 'pending') ? 'selected' : '' }}>در انتظار انتشار</option>
-                                                <option value="published" {{ (old('ReleaseStatus') == 'published') ? 'selected' : '' }}>منتشر شده</option>
-                                            </select>
-                                            @error('ReleaseStatus')
-                                                 <span class="invalid-feedback" role="alert">
-                                                         <strong>{{ $message }}</strong>
-                                                 </span>
-                                            @enderror
-                                        </div>
-
-                                    <div class="form-group">
-                                        <label for="discription">{{ __('product.discription') }}</label></label><i class="required">&nbsp;*</i>
-                                        <textarea id="discription" type="text"class="form-control editor @error('discription') is-invalid @enderror" name="discription" autocomplete="discription" autofocus>
-                                            {{ old('discription') }}
-                                        </textarea>
-
-                                        @error('discription')
-                                            <span class="invalid-feedback" role="alert">
-                                                 <strong>{{ $message }}</strong>
-                                             </span>
-                                        @enderror
-                                    </div>
-                                    <div class="form-group mb-0">
-                                        <div class="">
-                                            <button type="submit" class="btn btn-primary" >
-                                                {{ __('ثبت محصول') }}
-                                            </button>
-                                            <a href="{{ route('products.index') }}" type="button" class="btn btn-warning" > انصراف</a>
-                                        </div>
-                                    </div>
-                                    </div>
-                                </form>
-                            </div>
-                            <div class="card-footer">
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    @endslot
-
-    @slot('script')
-
-    @endslot
-
-@endcomponent
-

+ 87 - 0
packages/product/src/views/product/bundleProduct.blade.php

@@ -0,0 +1,87 @@
+@component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])
+
+    @slot('style')
+
+    @endslot
+    @slot('subject')
+        <h1><i class="fa fa-users"></i> ثبت محصول جدید </h1>
+        <p>ثبت محصول جدید در فروشگاه.</p>
+    @endslot
+    @slot('breadcrumb')
+        <li class="breadcrumb-item">محصولات</li>
+    @endslot
+
+    @slot('content')
+        <div class="auth-background h-auto py-5">
+            <div class="container py-5">
+                <div class="row align-items-center ">
+                    <div class="col-lg-12 col-md-12 mx-auto">
+                        <div class="card">
+                            <div class="card-header">
+                                <strong>{{ __('ثبت محصول ساده') }}</strong>
+                            </div>
+                            @component('product::components.message')
+                            @endcomponent
+                            <div class="card-body mx-lg-5 px-lg-3">
+                                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
+                                    @csrf
+                                    <div class="form-row ">
+                                    <div class="form-group col-lg-3">
+                                        <label for="sku">{{ __('product.sku') }}</label>
+                                        <input id="sku" type="text" class="form-control @error('sku') is-invalid @enderror" name="sku"
+                                               autocomplete="sku" value="{{ old('sku') }}" autofocus>
+                                        @error('sku')
+                                        <span class="invalid-feedback" role="alert">
+                                                     <strong>{{ $message }}</strong>
+                                                 </span>
+                                        @enderror
+                                    </div>
+                                    <div class="form-group col-lg-3">
+                                        <label for="status">{{ __('product.status') }}</label><i class="required">&nbsp;*</i>
+                                        <select id="status" type="text" class="form-control  @error('status') is-invalid @enderror" name="status" autocomplete="status">
+                                            <option value="">انتخاب کنید</option>
+                                            <option value="1" {{ (old('status') == '1') ? 'selected' : '' }}>موجود</option>
+                                            <option value="0" {{ (old('status') == '0') ? 'selected' : '' }}>ناموجود</option>
+                                        </select>
+                                        @error('status')
+                                        <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                        @enderror
+                                    </div>
+                                        <div class="form-group col-lg-3">
+                                            <label for="title">{{ __('product.price') }}</label><i class="required">&nbsp;*</i>
+                                            <input id="input.price" type="text" class="form-control price @error('price') is-invalid @enderror" name="price" value="{{ old('price') }}" autocomplete="price" autofocus>
+                                            @error('price')
+                                            <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                            @enderror
+                                        </div>
+                                        <div class="form-group col-lg-3">
+                                            <label for="sale_price">@lang('product.sale_price')</label>
+                                            <input id="sale_price" type="text" class="form-control price @error('sale_price') is-invalid @enderror" name="sale_price" value="{{ old('sale_price') }}" autocomplete="sale_price" autofocus>
+                                            @error('sale_price')
+                                            <span class="invalid-feedback" role="alert">
+                                                     <strong>{{ $message }}</strong>
+                                                 </span>
+                                            @enderror
+                                        </div>
+                                        </div>
+                                </form>
+                            </div>
+                            <div class="card-footer">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    @endslot
+
+    @slot('script')
+
+    @endslot
+
+@endcomponent
+

+ 2 - 15
packages/product/src/views/product/create.blade.php

@@ -34,7 +34,6 @@
                                                 </span>
                                                 </span>
                                         @enderror
                                         @enderror
                                     </div>
                                     </div>
-
                                     <div class="form-row">
                                     <div class="form-row">
                                         <div class="form-group col-lg-4">
                                         <div class="form-group col-lg-4">
                                             <label for="slug">{{ __('product.slug') }}</label>
                                             <label for="slug">{{ __('product.slug') }}</label>
@@ -43,16 +42,7 @@
                                                 <div class="alert alert-danger">{{$message}}</div>
                                                 <div class="alert alert-danger">{{$message}}</div>
                                             @enderror
                                             @enderror
                                         </div>
                                         </div>
-                                        <div class="form-group col-lg-4">
-                                            <label for="sku">{{ __('product.sku') }}</label>
-                                            <input id="sku" type="text" class="form-control @error('sku') is-invalid @enderror" name="sku"
-                                                   autocomplete="sku" value="{{ old('sku') }}" autofocus>
-                                            @error('sku')
-                                                <span class="invalid-feedback" role="alert">
-                                                     <strong>{{ $message }}</strong>
-                                                 </span>
-                                            @enderror
-                                        </div>
+
                                         <div class="form-group col-lg-4">
                                         <div class="form-group col-lg-4">
                                             <label for="type">{{ __('product.type') }}</label></label><i class="required"> *</i>
                                             <label for="type">{{ __('product.type') }}</label></label><i class="required"> *</i>
                                             <select id="type" type="text" class="form-control @error('type') is-invalid @enderror" name="type" value="{{ old('type') }}" autocomplete="type">
                                             <select id="type" type="text" class="form-control @error('type') is-invalid @enderror" name="type" value="{{ old('type') }}" autocomplete="type">
@@ -67,8 +57,6 @@
                                                 </span>
                                                 </span>
                                             @enderror
                                             @enderror
                                         </div>
                                         </div>
-                                    </div>
-
                                         <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">
@@ -83,7 +71,7 @@
                                                  </span>
                                                  </span>
                                             @enderror
                                             @enderror
                                         </div>
                                         </div>
-
+                                    </div>
                                     <div class="form-group">
                                     <div class="form-group">
                                         <label for="discription">{{ __('product.discription') }}</label></label><i class="required">&nbsp;*</i>
                                         <label for="discription">{{ __('product.discription') }}</label></label><i class="required">&nbsp;*</i>
                                         <textarea id="discription" type="text"class="form-control editor @error('discription') is-invalid @enderror" name="discription" autocomplete="discription" autofocus>
                                         <textarea id="discription" type="text"class="form-control editor @error('discription') is-invalid @enderror" name="discription" autocomplete="discription" autofocus>
@@ -104,7 +92,6 @@
                                             <a href="{{ route('products.index') }}" type="button" class="btn btn-warning" > انصراف</a>
                                             <a href="{{ route('products.index') }}" type="button" class="btn btn-warning" > انصراف</a>
                                         </div>
                                         </div>
                                     </div>
                                     </div>
-                                    </div>
                                 </form>
                                 </form>
                             </div>
                             </div>
                             <div class="card-footer">
                             <div class="card-footer">

+ 40 - 0
packages/product/src/views/product/include/variableAttribute.blade.php

@@ -0,0 +1,40 @@
+
+
+<div class="col-lg-12 col-md-12 mx-auto">
+    <div class="card">
+        <div class="card-header">
+                <strong>{{ __('انتخاب ویژگی ها') }}</strong>
+            </div>
+            <div class="card-body mx-lg-5 px-lg-3">
+                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data">
+                    @csrf
+                    <div class="form-row ">
+                        <div class="form-group col-lg-7">
+                            <label for="status">{{ __('attribute.titleProduct') }}</label><i class="required">&nbsp;*</i>
+                            <select id="status" type="text" class="form-control  @error('status') is-invalid @enderror" name="status" autocomplete="status">
+                                <option value="">انتخاب کنید</option>
+                                <option value="1" {{ (old('status') == '1') ? 'selected' : '' }}>موجود</option>
+                                <option value="0" {{ (old('status') == '0') ? 'selected' : '' }}> ناموجود </option>
+                            </select>
+                            @error('status')
+                            <span class="invalid-feedback" role="alert">
+                                 <strong>{{ $message }}</strong>
+                             </span>
+                            @enderror
+                        </div>
+                        <div class="col-lg-2">
+                            <button type="submit" class="btn btn-primary btn_create">
+                                {{ __('افزودن ') }}
+                            </button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="card-footer">
+            </div>
+        </div>
+    </div>
+
+
+
+

+ 87 - 0
packages/product/src/views/product/simpleProduct.blade.php

@@ -0,0 +1,87 @@
+@component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])
+
+    @slot('style')
+
+    @endslot
+    @slot('subject')
+        <h1><i class="fa fa-users"></i> ثبت محصول جدید </h1>
+        <p>ثبت محصول جدید در فروشگاه.</p>
+    @endslot
+    @slot('breadcrumb')
+        <li class="breadcrumb-item">محصولات</li>
+    @endslot
+
+    @slot('content')
+        <div class="auth-background h-auto py-5">
+            <div class="container py-5">
+                <div class="row align-items-center ">
+                    <div class="col-lg-12 col-md-12 mx-auto">
+                        <div class="card">
+                            <div class="card-header">
+                                <strong>{{ __('ثبت محصول ساده') }}</strong>
+                            </div>
+                            @component('product::components.message')
+                            @endcomponent
+                            <div class="card-body mx-lg-5 px-lg-3">
+                                <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
+                                    @csrf
+                                    <div class="form-row ">
+                                    <div class="form-group col-lg-3">
+                                        <label for="sku">{{ __('product.sku') }}</label>
+                                        <input id="sku" type="text" class="form-control @error('sku') is-invalid @enderror" name="sku"
+                                               autocomplete="sku" value="{{ old('sku') }}" autofocus>
+                                        @error('sku')
+                                        <span class="invalid-feedback" role="alert">
+                                                     <strong>{{ $message }}</strong>
+                                                 </span>
+                                        @enderror
+                                    </div>
+                                    <div class="form-group col-lg-3">
+                                        <label for="status">{{ __('product.status') }}</label><i class="required">&nbsp;*</i>
+                                        <select id="status" type="text" class="form-control  @error('status') is-invalid @enderror" name="status" autocomplete="status">
+                                            <option value="">انتخاب کنید</option>
+                                            <option value="1" {{ (old('status') == '1') ? 'selected' : '' }}>موجود</option>
+                                            <option value="0" {{ (old('status') == '0') ? 'selected' : '' }}>ناموجود</option>
+                                        </select>
+                                        @error('status')
+                                        <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                        @enderror
+                                    </div>
+                                        <div class="form-group col-lg-3">
+                                            <label for="title">{{ __('product.price') }}</label><i class="required">&nbsp;*</i>
+                                            <input id="input.price" type="text" class="form-control price @error('price') is-invalid @enderror" name="price" value="{{ old('price') }}" autocomplete="price" autofocus>
+                                            @error('price')
+                                            <span class="invalid-feedback" role="alert">
+                                                    <strong>{{ $message }}</strong>
+                                                </span>
+                                            @enderror
+                                        </div>
+                                        <div class="form-group col-lg-3">
+                                            <label for="sale_price">@lang('product.sale_price')</label>
+                                            <input id="sale_price" type="text" class="form-control price @error('sale_price') is-invalid @enderror" name="sale_price" value="{{ old('sale_price') }}" autocomplete="sale_price" autofocus>
+                                            @error('sale_price')
+                                            <span class="invalid-feedback" role="alert">
+                                                     <strong>{{ $message }}</strong>
+                                                 </span>
+                                            @enderror
+                                        </div>
+                                        </div>
+                                </form>
+                            </div>
+                            <div class="card-footer">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    @endslot
+
+    @slot('script')
+
+    @endslot
+
+@endcomponent
+

+ 65 - 0
packages/product/src/views/product/variableProduct.blade.php

@@ -0,0 +1,65 @@
+@component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])
+    @slot('style')
+    @endslot
+    @slot('subject')
+        <h1><i class="fa fa-users"></i> ثبت محصول متغیر </h1>
+        <p>ثبت محصول متغیر در فروشگاه.</p>
+    @endslot
+    @slot('breadcrumb')
+        <li class="breadcrumb-item"> محصولات متغیر</li>
+    @endslot
+    @slot('content')
+        <div class="auth-background h-auto">
+                @include('product::product.include.variableAttribute')
+        <div class="col-lg-12 col-md-12 mx-auto">
+            <div class="card">
+                <div class="card-header">
+                    <strong>{{ __('ثبت محصول متغییر') }}</strong>
+                </div>
+                @component('product::components.message')
+                @endcomponent
+                <div class="card-body mx-lg-5 px-lg-3">
+                    <form method="POST" action="{{ route('products.store') }}" enctype="multipart/form-data" >
+                        @csrf
+                        <div class="form-row ">
+                            <div class="form-group col-lg-7">
+                                <label for="status">{{ __('product.titleVariable') }}</label><i
+                                    class="required">&nbsp;*</i>
+                                <select id="status" type="text"
+                                        class="form-control  @error('status') is-invalid @enderror"
+                                        name="status" autocomplete="status">
+                                    <option value="">انتخاب کنید</option>
+                                    <option value="1" {{ (old('status') == '1') ? 'selected' : '' }}>موجود
+                                    </option>
+                                    <option value="0" {{ (old('status') == '0') ? 'selected' : '' }}>
+                                        ناموجود
+                                    </option>
+                                </select>
+                                @error('status')
+                                <span class="invalid-feedback" role="alert">
+                                      <strong>{{ $message }}</strong>
+                                </span>
+                                @enderror
+                            </div>
+                            <div class="col-lg-2">
+                                <button type="submit" class="btn btn-primary btn_create">
+                                    {{ __('افزودن ') }}
+                                </button>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+                <div class="card-footer">
+                </div>
+            </div>
+        </div>
+        </div>
+
+    @endslot
+
+    @slot('script')
+
+    @endslot
+
+@endcomponent
+

+ 11 - 0
resources/lang/fa/attribute.php

@@ -0,0 +1,11 @@
+<?php
+return [
+    'title' => 'عنوان ویژگی',
+    'titleProduct' => ' ویژگی ها',
+    'key' => ' key ',
+    'use_in_veriation' => ' استفاده از محصولات متغیر ',
+
+
+];
+
+

+ 1 - 0
resources/lang/fa/product.php

@@ -13,5 +13,6 @@ return [
   'gallery_image'       => 'عکس های محصول',
   'gallery_image'       => 'عکس های محصول',
   'gallery_images'       => 'ساخت گالری',
   'gallery_images'       => 'ساخت گالری',
   'featured_image'       => 'تصویر شاخص',
   'featured_image'       => 'تصویر شاخص',
+  'titleVariable'       => 'محصول متغیر',
 ];
 ];
 
 

+ 1 - 1
resources/lang/fa/validation.php

@@ -142,7 +142,7 @@ return [
     */
     */
 
 
     'attributes' => array_merge(
     'attributes' => array_merge(
-        __('product'),__('category'),
+        __('product'),__('category'),__('attribute'),
         [
         [
         'name'                  => 'نام',
         'name'                  => 'نام',
         'username'              => 'نام کاربری',
         'username'              => 'نام کاربری',