changes
This commit is contained in:
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Product\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Product\Models\FabricCategory;
|
||||
use Modules\Product\Repositories\FabricCategoryRepository;
|
||||
|
||||
class FabricCategoryController extends Controller
|
||||
{
|
||||
private $fabricCategoryRepository;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function __construct(
|
||||
FabricCategoryRepository $fabricCategoryRepository)
|
||||
{
|
||||
$this->fabricCategoryRepository = $fabricCategoryRepository;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Fabric Categories List';
|
||||
$data['fabric_categories'] = $this->fabricCategoryRepository->findAll();
|
||||
|
||||
return view('product::fabric_category.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Fabric Categories';
|
||||
$data['status'] = FabricCategory::STATUS;
|
||||
|
||||
return view('product::fabric_category.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
|
||||
$request->request->add(['slug' => slugify($request->title)]);
|
||||
$inputData = $request->all();
|
||||
$this->fabricCategoryRepository->create($inputData);
|
||||
toastr()->success('Category Created Succesfully');
|
||||
|
||||
return redirect()->route('fabricCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'Show Fabric Category';
|
||||
$data['status'] = FabricCategory::STATUS;
|
||||
$data['fabric_category'] = $this->fabricCategoryRepository->getFabricCategoryById($id);
|
||||
|
||||
return view('product::fabric_category.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Fabric Category';
|
||||
$data['status'] = FabricCategory::STATUS;
|
||||
$data['fabric_category'] = $this->fabricCategoryRepository->getFabricCategoryById($id);
|
||||
|
||||
return view('product::fabric_category.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$inputData = $request->except(['_method', '_token']);
|
||||
$this->fabricCategoryRepository->update($id, $inputData);
|
||||
|
||||
return redirect()->route('fabricCategory.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$FabricCategoryModel = $this->fabricCategoryRepository->getFabricCategoryById($id);
|
||||
$FabricCategoryModel->delete();
|
||||
|
||||
toastr()->success('Fabric Category Delete Succesfully');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'Fabric Category Delete Succesfully']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,10 @@ namespace Modules\Product\Http\Controllers;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Product\Models\FabricCategory;
|
||||
use Modules\Product\Models\Product;
|
||||
use Modules\Product\Repositories\CategoryRepository;
|
||||
use Modules\Product\Repositories\FabricCategoryRepository;
|
||||
use Modules\Product\Repositories\ProductInterface;
|
||||
use Modules\Product\Repositories\ProductRepository;
|
||||
use Modules\Product\Repositories\SubCategoryRepository;
|
||||
@ -19,6 +21,7 @@ class ProductController extends Controller
|
||||
private $productRepository;
|
||||
private $categoryRepository;
|
||||
private $subCategoryRepository;
|
||||
private $fabricCategoryRepository;
|
||||
private $warehouseRepository;
|
||||
private $supplierRepository;
|
||||
|
||||
@ -29,11 +32,13 @@ class ProductController extends Controller
|
||||
CategoryRepository $categoryRepository,
|
||||
SubCategoryRepository $subCategoryRepository,
|
||||
SupplierRepository $supplierRepository,
|
||||
FabricCategoryRepository $fabricCategoryRepository,
|
||||
WarehouseRepository $warehouseRepository)
|
||||
{
|
||||
$this->productRepository = $productRepository;
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
$this->subCategoryRepository = $subCategoryRepository;
|
||||
$this->fabricCategoryRepository = $fabricCategoryRepository;
|
||||
$this->supplierRepository = $supplierRepository;
|
||||
$this->warehouseRepository = $warehouseRepository;
|
||||
}
|
||||
@ -52,6 +57,7 @@ class ProductController extends Controller
|
||||
{
|
||||
$data['title'] = 'Create Product';
|
||||
$data['category'] = $this->categoryRepository->pluck();
|
||||
$data['fabricCategory'] = $this->fabricCategoryRepository->pluck();
|
||||
$data['subCategory'] = $this->subCategoryRepository->pluck();
|
||||
$data['supplier'] = $this->supplierRepository->pluck();
|
||||
$data['warehouse'] = $this->warehouseRepository->pluck();
|
||||
@ -92,6 +98,7 @@ class ProductController extends Controller
|
||||
$data['title'] = 'Show Product';
|
||||
$data['category'] = $this->categoryRepository->pluck();
|
||||
$data['subCategory'] = $this->subCategoryRepository->pluck();
|
||||
$data['fabricCategory'] = $this->fabricCategoryRepository->pluck();
|
||||
$data['supplier'] = $this->supplierRepository->pluck();
|
||||
$data['warehouse'] = $this->warehouseRepository->pluck();
|
||||
$data['product'] = $this->productRepository->getProductById($id);
|
||||
@ -127,4 +134,18 @@ class ProductController extends Controller
|
||||
|
||||
return response()->json(['status' => true, 'message' => 'Product Delete Succesfully']);
|
||||
}
|
||||
|
||||
public function getProductDetail(Request $request)
|
||||
{
|
||||
try {
|
||||
$productModel = $this->productRepository->getProductById($request->id);
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
|
||||
}
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'data' => $productModel,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
16
Modules/Product/app/Models/FabricCategory.php
Normal file
16
Modules/Product/app/Models/FabricCategory.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Product\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class FabricCategory extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
|
||||
protected $table = 'tbl_fabriccategories';
|
||||
protected $guarded = [];
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Modules\Supplier\Models\Supplier;
|
||||
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
USE StatusTrait;
|
||||
@ -25,10 +26,16 @@ class Product extends Model
|
||||
return $this->belongsTo(SubCategory::class, 'sub_category_id');
|
||||
}
|
||||
|
||||
public function fabricCategory()
|
||||
{
|
||||
return $this->belongsTo(FabricCategory::class, 'fabriccategory_id');
|
||||
}
|
||||
|
||||
public function warehouse()
|
||||
{
|
||||
return $this->belongsTo(Warehouse::class, 'warehouse_id');
|
||||
}
|
||||
|
||||
public function supplier()
|
||||
{
|
||||
return $this->belongsTo(Supplier::class, 'supplier_id');
|
||||
|
@ -4,6 +4,10 @@ namespace Modules\Product\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Product\Repositories\CategoryInterface;
|
||||
use Modules\Product\Repositories\CategoryRepository;
|
||||
use Modules\Product\Repositories\FabricCategoryInterface;
|
||||
use Modules\Product\Repositories\FabricCategoryRepository;
|
||||
use Modules\Product\Repositories\ProductInterface;
|
||||
use Modules\Product\Repositories\ProductRepository;
|
||||
|
||||
@ -33,6 +37,9 @@ class ProductServiceProvider extends ServiceProvider
|
||||
{
|
||||
$this->app->bind(ProductInterface::class,ProductRepository::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
$this->app->bind(CategoryInterface::class,CategoryRepository::class);
|
||||
$this->app->bind(FabricCategoryInterface::class,FabricCategoryRepository::class);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
15
Modules/Product/app/Repositories/FabricCategoryInterface.php
Normal file
15
Modules/Product/app/Repositories/FabricCategoryInterface.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Product\Repositories;
|
||||
|
||||
interface FabricCategoryInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getFabricCategoryById($FabricCategoryId);
|
||||
public function getFabricCategoryByEmail($email);
|
||||
public function delete($FabricCategoryId);
|
||||
public function create($FabricCategoryDetails);
|
||||
public function update($FabricCategoryId, array $newDetails);
|
||||
public function pluck();
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Product\Repositories;
|
||||
|
||||
use Modules\Product\Models\FabricCategory;
|
||||
|
||||
class FabricCategoryRepository implements FabricCategoryInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return FabricCategory::when(true, function ($query) {
|
||||
|
||||
})->paginate(20);
|
||||
}
|
||||
|
||||
public function getFabricCategoryById($FabricCategoryId)
|
||||
{
|
||||
return FabricCategory::findOrFail($FabricCategoryId);
|
||||
}
|
||||
|
||||
public function getFabricCategoryByEmail($email)
|
||||
{
|
||||
return FabricCategory::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function delete($FabricCategoryId)
|
||||
{
|
||||
FabricCategory::destroy($FabricCategoryId);
|
||||
}
|
||||
|
||||
public function create($FabricCategoryDetails)
|
||||
{
|
||||
return FabricCategory::create($FabricCategoryDetails);
|
||||
}
|
||||
|
||||
public function update($FabricCategoryId, array $newDetails)
|
||||
{
|
||||
return FabricCategory::whereId($FabricCategoryId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return FabricCategory::pluck('title', 'id');
|
||||
}
|
||||
|
||||
}
|
@ -44,3 +44,4 @@ class ProductRepository implements ProductInterface
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,9 +14,12 @@ return new class extends Migration
|
||||
Schema::create('tbl_products', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('code');
|
||||
$table->longText('desc')->nullable();
|
||||
$table->decimal('price', 10, 2);
|
||||
$table->integer('qty');
|
||||
$table->longText('remarks')->nullable();
|
||||
$table->decimal('price', 10, 2)->nullable();
|
||||
$table->integer('qty')->nullable();
|
||||
$table->unsignedBigInteger('fabriccategory_id')->nullable();
|
||||
$table->unsignedBigInteger('category_id')->nullable();
|
||||
$table->unsignedBigInteger('sub_category_id')->nullable();
|
||||
$table->unsignedBigInteger('supplier_id')->nullable();
|
||||
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTblFabriccategoriesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_fabriccategories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->string('color')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->text('remarks')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->dateTime('created_at')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->dateTime('updated_at')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_fabriccategories');
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTblMasterunitsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_masterunits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->text('remarks')->nullable();
|
||||
$table->dateTime('created_at')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->dateTime('updated_at')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_masterunits');
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTblStocksTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_stocks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('stocklocation_id')->nullable();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->integer('product_id')->nullable();
|
||||
$table->string('s')->nullable();
|
||||
$table->string('m')->nullable();
|
||||
$table->string('l')->nullable();
|
||||
$table->string('xl')->nullable();
|
||||
$table->string('xxl')->nullable();
|
||||
$table->string('xxxl')->nullable();
|
||||
$table->string('fs')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->text('remarks')->nullable();
|
||||
$table->dateTime('created_at')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->dateTime('updated_at')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_stocks');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTblPaymentmodesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_paymentmodes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->text('remarks')->nullable();
|
||||
$table->dateTime('created_at')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->dateTime('updated_at')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_paymentmodes');
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateTblStocklocationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tbl_stocklocations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->integer('display_order')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->text('remarks')->nullable();
|
||||
$table->timestamps();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('tbl_stocklocations');
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
{{ html()->form('POST')->route('fabricCategory.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
@include('product::fabric_category.partials.action')
|
||||
{{ html()->form()->close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
<!-- end page title -->
|
||||
|
||||
{{ html()->modelForm($fabric_category, 'PUT')->route('fabricCategory.update', $fabric_category->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
|
||||
|
||||
@include('product::fabric_category.partials.action')
|
||||
|
||||
{{ html()->closeModelForm() }}
|
||||
|
||||
</div>
|
||||
<!-- container-fluid -->
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -0,0 +1,72 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
|
||||
<div class="mb-2 text-end">
|
||||
@can('fabricCategory.create')
|
||||
<a href="{{ route('fabricCategory.create') }}" class="btn btn-success btn-md waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Title</th>
|
||||
<th>Slug</th>
|
||||
<th>Color</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($fabric_categories as $key => $fabricCategory)
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $fabricCategory->title }}</td>
|
||||
<td>{{ $fabricCategory->slug }}</td>
|
||||
<td>{{ $fabricCategory->color }}</td>
|
||||
<td>{!! $fabricCategory->status_name !!}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
@can('fabricCategory.show')
|
||||
<a href="{{ route('fabricCategory.show', $fabricCategory->id) }}" class="link-info fs-15">
|
||||
<i class="ri-eye-line"></i>
|
||||
</a>
|
||||
@endcan
|
||||
@can('fabricCategory.edit')
|
||||
<a href="{{ route('fabricCategory.edit', $fabricCategory->id) }}"
|
||||
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
@endcan
|
||||
@can('fabricCategory.destroy')
|
||||
<a href="javascript:void(0);"
|
||||
data-link="{{ route('fabricCategory.destroy', $fabricCategory->id) }}"
|
||||
data-id="{{ $fabricCategory->id }}" class="link-danger fs-15 remove-item-btn"><i
|
||||
class="ri-delete-bin-line"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,60 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row gy-1">
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Color')->class('form-label') }}
|
||||
{{ html()->text('color')->class('form-control')->placeholder('Enter Color')->required() }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->text('description')->class('form-control')->placeholder('Enter Description') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->text('remarks')->class('form-control')->placeholder('Enter Remarks') }}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('fabricCategory.index') }}" class="btn btn-danger w-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Publish</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Status')->class('form-label') }}
|
||||
{{-- {{ html()->select('status', '11')->class('form-control')->placeholder('Select Status') }}
|
||||
--}}
|
||||
{{ html()->select('status', $status)->class('form-control')->placeholder('Select Status')->required() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,45 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card card-body p-4">
|
||||
<div>
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless mb-0 table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Title</span></th>
|
||||
<td>{{ $fabric_category->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Description</span></th>
|
||||
<td>{{ $fabric_category->description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Remarks</span></th>
|
||||
<td>{{ $fabric_category->remarks }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('fabricCategory.index') }}" class="btn btn-secondary w-sm">Back</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
|
||||
@endpush
|
@ -22,28 +22,23 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.N</th>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th>Quantity</th>
|
||||
<th>Category</th>
|
||||
<th>Sub Category</th>
|
||||
<th>Supplier</th>
|
||||
<th>Warehouse</th>
|
||||
<th>Title</th>
|
||||
<th>Fabric Category</th>
|
||||
<th>Product Category</th>
|
||||
<th>Product Code</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($products as $key => $product)
|
||||
{{-- @dd($product->fabricCategory) --}}
|
||||
<tr>
|
||||
<td>{{ $key + 1 }}</td>
|
||||
<td>{{ $product->name }}</td>
|
||||
<td>{{ $product->price }}</td>
|
||||
<td>{{ $product->qty }}</td>
|
||||
<td>{{ optional($product->fabricCategory)->title }}</td>
|
||||
<td>{{ optional($product->category)->title }}</td>
|
||||
<td>{{ optional($product->subCategory)->title }}</td>
|
||||
<td>{{ optional($product->supplier)->supplier_name }}</td>
|
||||
<td>{{ optional($product->warehouse)->title }}</td>
|
||||
<td>{{ $product->code }}</td>
|
||||
<td>{!! $product->status_name !!}</td>
|
||||
<td>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
|
@ -9,40 +9,30 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Price')->class('form-label') }}
|
||||
{{ html()->text('price')->class('form-control')->placeholder('Enter Price')->required() }}
|
||||
{{ html()->label('Product Code')->class('form-label') }}
|
||||
{{ html()->text('code')->class('form-control')->placeholder('Enter Product Code')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Quantity')->class('form-label') }}
|
||||
{{ html()->text('qty')->class('form-control')->placeholder('Enter Quantity')->required() }}
|
||||
{{ html()->label('Fabric Category')->class('form-label') }}
|
||||
{{ html()->select('fabriccategory_id', $fabricCategory)->class('form-select select2')->placeholder('Select Fabric Category')->id('fabric_category_id') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Category')->class('form-label') }}
|
||||
{{ html()->select('category_id', $category)->class('form-select select2')->placeholder('Select Category')->id('category_id') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Sub Category')->class('form-label') }}
|
||||
{{ html()->select('sub_category_id', $subCategory)->class('form-select select2')->placeholder('Select Sub Category')->id('sub_category_id') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Supplier')->class('form-label') }}
|
||||
{{ html()->select('supplier_id', $supplier)->class('form-select select2')->placeholder('Select Supplier') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Warehouse')->class('form-label') }}
|
||||
{{ html()->select('warehouse_id', $warehouse)->class('form-select select2')->placeholder('Select Warehouse') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('desc')->class('form-control')->placeholder('Enter Description')->required() }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->placeholder('Enter Remarks')->required() }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
@ -73,14 +63,14 @@
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
{{-- <script>
|
||||
$(document).on('change', '#category_id', function(e) {
|
||||
e.preventDefault();
|
||||
var category_id = $(this).val();
|
||||
if (category_id) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "{{ route('getSubCategories') }}",
|
||||
url: "{{ route('getSubCategories') }}" ,
|
||||
data: {
|
||||
'category_id': category_id
|
||||
},
|
||||
@ -94,5 +84,5 @@
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script> --}}
|
||||
@endpush
|
@ -17,31 +17,23 @@
|
||||
<td>{{ $product->name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Price</span></th>
|
||||
<td>{{ $product->price }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Quantity</span></th>
|
||||
<td>{{ $product->qty }}</td>
|
||||
<th><span class="fw-medium">Product Code</span></th>
|
||||
<td>{{ $product->code }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Category</span></th>
|
||||
<td>{{ optional($product->category)->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Sub Category</span></th>
|
||||
<td>{{ optional($product->subCategory)->title }}</td>
|
||||
<th><span class="fw-medium">Fabric Category</span></th>
|
||||
<td>{{ optional($product->fabricCategory)->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Supplier</span></th>
|
||||
<td>{{ optional($product->supplier)->supplier_name }}</td>
|
||||
<th><span class="fw-medium">Description</span></th>
|
||||
<td>{{ optional($product->desc) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Warehouse</span></th>
|
||||
<td>{{ optional($product->warehouse)->title }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<th><span class="fw-medium">Status</span></th>
|
||||
<td>{{ $product->status }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Product\Http\Controllers\CategoryController;
|
||||
use Modules\Product\Http\Controllers\FabricCategoryController;
|
||||
use Modules\Product\Http\Controllers\ProductController;
|
||||
use Modules\Product\Http\Controllers\SubCategoryController;
|
||||
use Modules\Product\Http\Controllers\WarehouseController;
|
||||
@ -22,7 +23,9 @@ Route::group([], function () {
|
||||
Route::resource('category', CategoryController::class)->names('category');
|
||||
Route::resource('sub-category', SubCategoryController::class)->names('subCategory');
|
||||
Route::resource('warehouse', WarehouseController::class)->names('warehouse');
|
||||
Route::resource('fabricCategory', FabricCategoryController::class)->names('fabricCategory');
|
||||
Route::get('get-sub-categories', [SubCategoryController::class, 'getSubCategories'])->name('getSubCategories');
|
||||
Route::get('product-details', [ProductController::class, 'getProductDetail'])->name('get-product-detail');
|
||||
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user