first commit

This commit is contained in:
Sampanna Rimal
2024-08-27 17:48:06 +05:45
commit 53c0140f58
10839 changed files with 1125847 additions and 0 deletions

View File

@ -0,0 +1,19 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
@include('layouts.partials.breadcrumb', ['title' => $title])
{{ html()->form('POST')->route('product.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('product::product.partials.action')
{{ html()->form()->close() }}
</div>
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,22 @@
@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($product, 'PUT')->route('product.update', $product->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data'])->open() }}
@include('product::product.partials.action')
{{ html()->closeModelForm() }}
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,79 @@
@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('product.create')
<a href="{{ route('product.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>Name</th>
<th>Price</th>
<th>Quantity</th>
<th>Category</th>
<th>Sub Category</th>
<th>Supplier</th>
<th>Warehouse</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@forelse ($products as $key => $product)
<tr>
<td>{{ $key + 1 }}</td>
<td>{{ $product->name }}</td>
<td>{{ $product->price }}</td>
<td>{{ $product->qty }}</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->status_name !!}</td>
<td>
<div class="hstack flex-wrap gap-3">
@can('product.show')
<a href="{{ route('product.show', $product->id) }}" class="link-info fs-15">
<i class="ri-eye-line"></i>
</a>
@endcan
@can('product.edit')
<a href="{{ route('product.edit', $product->id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
@endcan
@can('product.destroy')
<a href="javascript:void(0);" data-link="{{ route('product.destroy', $product->id) }}"
data-id="{{ $product->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

View File

@ -0,0 +1,98 @@
<div class="row">
<div class="col-lg-9">
<div class="card">
<div class="card-body">
<div class="row gy-1">
<div class="col-md-6">
{{ html()->label('Product Name')->class('form-label') }}
{{ html()->text('name')->class('form-control')->placeholder('Enter Product Name')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Price')->class('form-label') }}
{{ html()->text('price')->class('form-control')->placeholder('Enter Price')->required() }}
</div>
<div class="col-md-6">
{{ html()->label('Quantity')->class('form-label') }}
{{ html()->text('qty')->class('form-control')->placeholder('Enter Quantity')->required() }}
</div>
<div class="col-md-4">
{{ 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>
<!-- end card -->
</div>
<!-- end card -->
</div>
<div class="mb-3 text-end">
<a href="{{ route('product.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-3">
<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', $status)->class('form-control')->placeholder('Select Status')->required() }}
</div>
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
@push('js')
<script>
$(document).on('change', '#category_id', function(e) {
e.preventDefault();
var category_id = $(this).val();
if (category_id) {
$.ajax({
type: "GET",
url: "{{ route('getSubCategories') }}",
data: {
'category_id': category_id
},
dataType: "json",
success: function(response) {
$('#sub_category_id').html('<option value="#" selected disabled>Select Sub Category</option>');
$.each(response.message, function(key, value) {
$('#sub_category_id').append('<option value=' + value.id + '>' + value.title + '</option>');
});
}
});
}
});
</script>
@endpush

View File

@ -0,0 +1,65 @@
@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">Product Name</span></th>
<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>
</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>
</tr>
<tr>
<th><span class="fw-medium">Supplier</span></th>
<td>{{ optional($product->supplier)->supplier_name }}</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>
<td>{{ $product->status }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="mb-3 text-end">
<a href="{{ route('product.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