data grid empty values in filters redirecting to exception is now fixed.
This commit is contained in:
parent
9e3c3a357a
commit
ec8fdeca6f
|
|
@ -134,6 +134,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
|
||||
|
||||
// Datagrid Routes
|
||||
|
||||
//for datagrid and its loading, filtering, sorting and queries
|
||||
Route::get('datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index');
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ window.VeeValidate = require("vee-validate");
|
|||
|
||||
Vue.use(VeeValidate);
|
||||
|
||||
$(document).ready(function () {
|
||||
Vue.config.ignoredElements = [
|
||||
'option-wrapper',
|
||||
'group-form',
|
||||
'group-list'
|
||||
];
|
||||
Vue.component("datetime", require("./components/datetime"));
|
||||
Vue.component("date", require("./components/date"));
|
||||
require("vue-flatpickr/theme/airbnb.css");
|
||||
|
||||
$(document).ready(function() {
|
||||
Vue.config.ignoredElements = ["option-wrapper", "group-form", "group-list"];
|
||||
|
||||
var app = new Vue({
|
||||
el: "#app",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<template>
|
||||
<Flatpickr class="control" :options="fpOptions"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueFlatpickr from "vue-flatpickr";
|
||||
|
||||
Vue.use(VueFlatpickr);
|
||||
|
||||
export default {
|
||||
props: {
|
||||
default: String
|
||||
},
|
||||
|
||||
data() {
|
||||
const now = new Date(this.default);
|
||||
|
||||
return {
|
||||
fpOptions: {
|
||||
utc: false,
|
||||
enableTime: false
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,38 +1,27 @@
|
|||
<template>
|
||||
<Flatpickr class="datetime-field" :options="fpOptions" />
|
||||
<Flatpickr class="control" :options="fpOptions"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
window.Vue = require("vue");
|
||||
import VueFlatpickr from "vue-flatpickr";
|
||||
import "vue-flatpickr/theme/airbnb.css";
|
||||
import VueFlatpickr from "vue-flatpickr";
|
||||
|
||||
Vue.use(VueFlatpickr);
|
||||
Vue.use(VueFlatpickr);
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const now = new Date();
|
||||
console.log(now);
|
||||
return {
|
||||
fpOptions: {
|
||||
utc: false,
|
||||
defaultDate: now,
|
||||
enableTime: true
|
||||
}
|
||||
};
|
||||
},
|
||||
export default {
|
||||
props: {
|
||||
default: String
|
||||
},
|
||||
|
||||
mounted: function() {
|
||||
console.log("Date time compoenent mounted");
|
||||
}
|
||||
};
|
||||
data() {
|
||||
const now = new Date(this.default);
|
||||
|
||||
return {
|
||||
fpOptions: {
|
||||
utc: false,
|
||||
defaultDate: now,
|
||||
enableTime: true
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.datetime-field {
|
||||
border: 2px solid #c7c7c7;
|
||||
border-radius: 3px;
|
||||
font-family: "Montserrat", sans-serif;
|
||||
height: 35px;
|
||||
padding-left: 5px;
|
||||
color: gray;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,9 @@ return [
|
|||
'sku' => 'SKU',
|
||||
'configurable-attributes' => 'Configurable Attributes',
|
||||
'attribute-header' => 'Attribute(s)',
|
||||
'attribute-option-header' => 'Attribute Option(s)'
|
||||
'attribute-option-header' => 'Attribute Option(s)',
|
||||
'no' => 'No',
|
||||
'yes' => 'Yes'
|
||||
],
|
||||
'attributes' => [
|
||||
'add-title' => 'Add Attribute',
|
||||
|
|
@ -92,7 +94,6 @@ return [
|
|||
'boolean' => 'Boolean',
|
||||
'select' => 'Select',
|
||||
'multiselect' => 'Multiselect',
|
||||
'checkbox' => 'Checkbox',
|
||||
'datetime' => 'Datetime',
|
||||
'date' => 'Date',
|
||||
'label' => 'Label',
|
||||
|
|
@ -116,7 +117,8 @@ return [
|
|||
'value_per_channel' => 'Value Per Channel',
|
||||
'value_per_channel' => 'Value Per Channel',
|
||||
'is_filterable' => 'Use in Layered Navigation',
|
||||
'is_configurable' => 'Use To Create Configurable Product'
|
||||
'is_configurable' => 'Use To Create Configurable Product',
|
||||
'admin_name' => 'Admin Name'
|
||||
],
|
||||
'families' => [
|
||||
'families' => 'Families',
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
<option value="boolean">{{ __('admin::app.catalog.attributes.boolean') }}</option>
|
||||
<option value="select">{{ __('admin::app.catalog.attributes.select') }}</option>
|
||||
<option value="multiselect">{{ __('admin::app.catalog.attributes.multiselect') }}</option>
|
||||
<option value="checkbox">{{ __('admin::app.catalog.attributes.checkbox') }}</option>
|
||||
<option value="datetime">{{ __('admin::app.catalog.attributes.datetime') }}</option>
|
||||
<option value="date">{{ __('admin::app.catalog.attributes.date') }}</option>
|
||||
</select>
|
||||
|
|
@ -104,8 +103,7 @@
|
|||
<label for="validation">{{ __('admin::app.catalog.attributes.input_validation') }}</label>
|
||||
<select class="control" id="validation" name="validation">
|
||||
<option value=""></option>
|
||||
<option value="number">{{ __('admin::app.catalog.attributes.number') }}</option>
|
||||
<option value="decimal">{{ __('admin::app.catalog.attributes.decimal') }}</option>
|
||||
<option value="numeric">{{ __('admin::app.catalog.attributes.number') }}</option>
|
||||
<option value="email">{{ __('admin::app.catalog.attributes.email') }}</option>
|
||||
<option value="url">{{ __('admin::app.catalog.attributes.url') }}</option>
|
||||
</select>
|
||||
|
|
@ -173,6 +171,8 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
|
||||
|
||||
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||
|
||||
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
|
||||
|
|
@ -187,6 +187,13 @@
|
|||
|
||||
<tbody>
|
||||
<tr v-for="row in optionRows">
|
||||
<td>
|
||||
<div class="control-group" :class="[errors.has(adminName(row)) ? 'has-error' : '']">
|
||||
<input type="text" v-validate="'required'" v-model="row['admin_name']" :name="adminName(row)" class="control"/>
|
||||
<span class="control-error" v-if="errors.has(adminName(row))">@{{ errors.first(adminName(row)) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||
<td>
|
||||
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
|
||||
|
|
@ -253,6 +260,10 @@
|
|||
Vue.delete(this.optionRows, index);
|
||||
},
|
||||
|
||||
adminName (row) {
|
||||
return 'options[' + row.id + '][admin_name]';
|
||||
},
|
||||
|
||||
localeInputName (row, locale) {
|
||||
return 'options[' + row.id + '][' + locale + '][label]';
|
||||
},
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@
|
|||
<option value="multiselect" {{ $selectedOption == 'multiselect' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.catalog.attributes.multiselect') }}
|
||||
</option>
|
||||
<option value="checkbox" {{ $selectedOption == 'checkbox' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.catalog.attributes.checkbox') }}
|
||||
</option>
|
||||
<option value="datetime" {{ $selectedOption == 'datetime' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.catalog.attributes.datetime') }}
|
||||
</option>
|
||||
|
|
@ -231,6 +228,8 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
|
||||
|
||||
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||
|
||||
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
|
||||
|
|
@ -245,6 +244,13 @@
|
|||
|
||||
<tbody>
|
||||
<tr v-for="row in optionRows">
|
||||
<td>
|
||||
<div class="control-group" :class="[errors.has(adminName(row)) ? 'has-error' : '']">
|
||||
<input type="text" v-validate="'required'" v-model="row['admin_name']" :name="adminName(row)" class="control"/>
|
||||
<span class="control-error" v-if="errors.has(adminName(row))">@{{ errors.first(adminName(row)) }}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||
<td>
|
||||
<div class="control-group" :class="[errors.has(localeInputName(row, '{{ $locale->code }}')) ? 'has-error' : '']">
|
||||
|
|
@ -292,7 +298,7 @@
|
|||
created () {
|
||||
@foreach($attribute->options as $option)
|
||||
this.optionRowCount++;
|
||||
var row = {'id': '{{ $option->id }}', 'sort_order': '{{ $option->sort_order }}'};
|
||||
var row = {'id': '{{ $option->id }}', 'admin_name': '{{ $option->admin_name }}', 'sort_order': '{{ $option->sort_order }}'};
|
||||
|
||||
@foreach(Webkul\Core\Models\Locale::all() as $locale)
|
||||
row['{{ $locale->code }}'] = "{{ $option->translate($locale->code)['label'] }}";
|
||||
|
|
@ -324,6 +330,10 @@
|
|||
Vue.delete(this.optionRows, index);
|
||||
},
|
||||
|
||||
adminName (row) {
|
||||
return 'options[' + row.id + '][admin_name]';
|
||||
},
|
||||
|
||||
localeInputName (row, locale) {
|
||||
return 'options[' + row.id + '][' + locale + '][label]';
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
<div class="control-group">
|
||||
<label for="sku">{{ $attribute->admin_name }}</label>
|
||||
<input type="text" class="control" id="sku" name="sku"/>
|
||||
</div>
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
<td>
|
||||
@foreach($attribute->options as $option)
|
||||
<span class="label">
|
||||
<input type="hidden" name="super_attributes[{{$attribute->id}}][options][]" value="{{ $option->id }}"/>
|
||||
<input type="hidden" name="super_attributes[{{$attribute->code}}][]" value="{{ $option->id }}"/>
|
||||
{{ $option->label }}
|
||||
|
||||
<i class="icon cross-icon"></i>
|
||||
|
|
|
|||
|
|
@ -26,9 +26,24 @@
|
|||
|
||||
@foreach($attributeGroup->attributes as $attribute)
|
||||
|
||||
@if(view()->exists($typeView = 'admin::catalog.products.attribute-types.' . $attribute->type))
|
||||
@if(!$product->super_attributes->contains($attribute))
|
||||
|
||||
@include ($typeView)
|
||||
<?php
|
||||
$validations = [];
|
||||
if($attribute->is_required) {
|
||||
array_push($validations, 'required');
|
||||
}
|
||||
|
||||
array_push($validations, $attribute->validation);
|
||||
|
||||
$validations = implode('|', array_filter($validations));
|
||||
?>
|
||||
|
||||
@if(view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
|
||||
|
||||
@include ($typeView)
|
||||
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}">
|
||||
<option value="0" {{ !$product[$attribute->code] ? 'selected' : ''}}>
|
||||
{{ __('admin::app.catalog.products.no') }}
|
||||
</option>
|
||||
<option value="1" {{ $product[$attribute->code] ? 'selected' : ''}}>
|
||||
{{ __('admin::app.catalog.products.yes') }}
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ $product[$attribute->code]}}"/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ $product[$attribute->code]}}"/>
|
||||
|
||||
<datetime default="{{ $product[$attribute->code]}}"></datetime>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" multiple>
|
||||
|
||||
@foreach($attribute->options as $option)
|
||||
<option value="{{ $option->id }}" {{ in_array($option->id, explode(',', $attribute[$attribute->code])) ? 'selected' : ''}}>
|
||||
{{ $option->admin_name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ $product[$attribute->code]}}"/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}">
|
||||
|
||||
@foreach($attribute->options as $option)
|
||||
<option value="{{ $option->id }}" {{ $option->id == $attribute[$attribute->code] ? 'selected' : ''}}>
|
||||
{{ $option->admin_name }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ $product[$attribute->code]}}"/>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<div class="control-group" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
</label>
|
||||
|
||||
<textarea v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}">
|
||||
{{ $product[$attribute->code]}}
|
||||
</textarea>
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
</div>
|
||||
|
|
@ -15,6 +15,7 @@ class CreateAttributeOptionsTable extends Migration
|
|||
{
|
||||
Schema::create('attribute_options', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('admin_name')->nullable();
|
||||
$table->integer('sort_order')->nullable();
|
||||
$table->integer('attribute_id')->unsigned();
|
||||
$table->foreign('attribute_id')->references('id')->on('attributes')->onDelete('cascade');
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ class Attribute extends TranslatableModel
|
|||
|
||||
protected $fillable = ['code', 'admin_name', 'type', 'position', 'is_required', 'is_unique', 'value_per_locale', 'value_per_channel', 'is_filterable', 'is_configurable'];
|
||||
|
||||
protected $with = ['options'];
|
||||
|
||||
/**
|
||||
* Get the options.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -7,4 +7,42 @@
|
|||
return new Core;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('array_permutation')) {
|
||||
function array_permutation($input)
|
||||
{
|
||||
$results = [];
|
||||
|
||||
while (list($key, $values) = each($input)) {
|
||||
if (empty($values)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (empty($results)) {
|
||||
foreach($values as $value) {
|
||||
$results[] = [$key => $value];
|
||||
}
|
||||
} else {
|
||||
$append = [];
|
||||
|
||||
foreach($results as &$result) {
|
||||
$result[$key] = array_shift($values);
|
||||
|
||||
$copy = $result;
|
||||
|
||||
foreach($values as $item) {
|
||||
$copy[$key] = $item;
|
||||
$append[] = $copy;
|
||||
}
|
||||
|
||||
array_unshift($values, $result[$key]);
|
||||
}
|
||||
|
||||
$results = array_merge($results, $append);
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
|||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateProductAttributeValueTable extends Migration
|
||||
class CreateProductAttributeValuesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
|
@ -13,7 +13,7 @@ class CreateProductAttributeValueTable extends Migration
|
|||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('product_attribute_value', function (Blueprint $table) {
|
||||
Schema::create('product_attribute_values', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('locale')->nullable();
|
||||
$table->text('text_value')->nullable();
|
||||
|
|
@ -25,7 +25,7 @@ class CreateProductAttributeValueTable extends Migration
|
|||
$table->json('json_value')->nullable();
|
||||
$table->integer('product_id')->unsigned();
|
||||
$table->integer('attribute_id')->unsigned();
|
||||
$table->integer('channel_id')->unsigned();
|
||||
$table->integer('channel_id')->nullable()->unsigned();
|
||||
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
|
||||
$table->foreign('attribute_id')->references('id')->on('attributes')->onDelete('cascade');
|
||||
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
|
||||
|
|
@ -40,6 +40,6 @@ class CreateProductAttributeValueTable extends Migration
|
|||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('product_attribute_value');
|
||||
Schema::dropIfExists('product_attribute_values');
|
||||
}
|
||||
}
|
||||
|
|
@ -118,8 +118,6 @@ class ProductController extends Controller
|
|||
{
|
||||
$product = $this->product->findOrFail($id);
|
||||
|
||||
dd($product);
|
||||
|
||||
return view($this->_config['view'], compact('product'));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,16 +3,31 @@
|
|||
namespace Webkul\Product\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Category\Models\Category;
|
||||
use Webkul\Inventory\Models\InventorySource;
|
||||
use Webkul\Attribute\Models\AttributeFamily;
|
||||
use Webkul\Category\Models\Category;
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Product\Models\ProductAttributeValue;
|
||||
use Webkul\Inventory\Models\InventorySource;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
protected $fillable = ['type', 'attribute_family_id', 'sku'];
|
||||
protected $fillable = ['type', 'attribute_family_id', 'sku', 'parent_id'];
|
||||
|
||||
protected $with = ['super_attributes'];
|
||||
protected $with = ['attribute_values', 'varients'];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeTypeFields = [
|
||||
'text' => 'text_value',
|
||||
'textarea' => 'text_value',
|
||||
'price' => 'float_value',
|
||||
'boolean' => 'boolean_value',
|
||||
'select' => 'integer_value',
|
||||
'multiselect' => 'text_value',
|
||||
'datetime' => 'datetime_time',
|
||||
'date' => 'date_value',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the product attribute family that owns the product.
|
||||
|
|
@ -22,6 +37,22 @@ class Product extends Model
|
|||
return $this->belongsTo(AttributeFamily::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the product attribute values that owns the product.
|
||||
*/
|
||||
public function attribute_values()
|
||||
{
|
||||
return $this->hasMany(ProductAttributeValue::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the product varients that owns the product.
|
||||
*/
|
||||
public function varients()
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* The categories that belong to the product.
|
||||
*/
|
||||
|
|
@ -70,11 +101,28 @@ class Product extends Model
|
|||
return $this->belongsToMany(self::class, 'product_cross_sells');
|
||||
}
|
||||
|
||||
public function __get($name) {
|
||||
// if(array_key_exists($name, $this->data)) {
|
||||
// return $this->data[$name];
|
||||
// }
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function attributesToArray()
|
||||
{
|
||||
$attributes = parent::attributesToArray();
|
||||
|
||||
return null;
|
||||
$hiddenAttributes = $this->getHidden();
|
||||
|
||||
foreach ($this->attribute_values as $attributeValue) {
|
||||
|
||||
$attribute = $attributeValue->attribute;
|
||||
|
||||
if (in_array($attribute->code, $hiddenAttributes)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value = $attributeValue[$this->attributeTypeFields[$attribute->type]]) {
|
||||
$attributes[$attribute->code] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,15 +5,34 @@ namespace Webkul\Product\Models;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Attribute\Models\Attribute;
|
||||
use Webkul\Product\Models\Product;
|
||||
use Webkul\Channel\Models\Channel;
|
||||
|
||||
class ProductAttributeValue extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $with = ['attribute'];
|
||||
|
||||
protected $fillable = [
|
||||
'product_id',
|
||||
'attribute_id',
|
||||
'channel_id',
|
||||
'locale',
|
||||
'text_value',
|
||||
'boolean_value',
|
||||
'integer_value',
|
||||
'float_value',
|
||||
'datetime_value',
|
||||
'date_value',
|
||||
'json_value'
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attribue that owns the attribute value.
|
||||
* Get the attribute that owns the attribute value.
|
||||
*/
|
||||
public function attribue()
|
||||
public function attribute()
|
||||
{
|
||||
return $this->belongsTo(Attribue::class);
|
||||
return $this->belongsTo(Attribute::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -23,4 +42,12 @@ class ProductAttributeValue extends Model
|
|||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channel that owns the attribute value.
|
||||
*/
|
||||
public function channel()
|
||||
{
|
||||
return $this->belongsTo(Channel::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Webkul\Product\Repositories;
|
||||
|
||||
use Illuminate\Container\Container as App;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
/**
|
||||
|
|
@ -12,6 +14,40 @@ use Webkul\Core\Eloquent\Repository;
|
|||
*/
|
||||
class ProductAttributeValueRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* AttributeRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attribute;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeTypeFields = [
|
||||
'text' => 'text_value',
|
||||
'textarea' => 'text_value',
|
||||
'price' => 'float_value',
|
||||
'boolean' => 'boolean_value',
|
||||
'select' => 'integer_value',
|
||||
'multiselect' => 'text_value',
|
||||
'datetime' => 'datetime_time',
|
||||
'date' => 'date_value',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attribute
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(AttributeRepository $attribute, App $app)
|
||||
{
|
||||
$this->attribute = $attribute;
|
||||
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
|
|
@ -28,12 +64,10 @@ class ProductAttributeValueRepository extends Repository
|
|||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
$product = $this->model->create($data);
|
||||
$attribute = $this->attribute->find($data['attribute_id']);
|
||||
|
||||
foreach ($data['super_attributes'] as $attributeId => $attribute) {
|
||||
$product->super_attributes()->attach($attributeId);
|
||||
}
|
||||
$data[$this->attributeTypeFields[$attribute->type]] = $data['value'];
|
||||
|
||||
return $product;
|
||||
return $this->model->create($data);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
namespace Webkul\Product\Repositories;
|
||||
|
||||
use Illuminate\Container\Container as App;
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
use Webkul\Attribute\Repositories\AttributeRepository;
|
||||
use Webkul\Product\Repositories\ProductAttributeValueRepository;
|
||||
|
||||
/**
|
||||
* Product Reposotory
|
||||
|
|
@ -12,6 +15,39 @@ use Webkul\Core\Eloquent\Repository;
|
|||
*/
|
||||
class ProductRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* AttributeRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attribute;
|
||||
|
||||
/**
|
||||
* ProductAttributeValueRepository object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $attributeValue;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param Webkul\Attribute\Repositories\AttributeRepository $attribute
|
||||
* @param Webkul\Attribute\Repositories\ProductAttributeValueRepository $attributeValue
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
AttributeRepository $attribute,
|
||||
ProductAttributeValueRepository $attributeValue,
|
||||
App $app)
|
||||
{
|
||||
$this->attribute = $attribute;
|
||||
|
||||
$this->attributeValue = $attributeValue;
|
||||
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
|
|
@ -31,11 +67,46 @@ class ProductRepository extends Repository
|
|||
$product = $this->model->create($data);
|
||||
|
||||
if(isset($data['super_attributes'])) {
|
||||
foreach ($data['super_attributes'] as $attributeId => $attribute) {
|
||||
$product->super_attributes()->attach($attributeId);
|
||||
|
||||
$super_attributes = [];
|
||||
|
||||
foreach ($data['super_attributes'] as $attributeCode => $attributeOptions) {
|
||||
$attribute = $this->attribute->findBy('code', $attributeCode);
|
||||
|
||||
$super_attributes[$attribute->id] = $attributeOptions;
|
||||
|
||||
$product->super_attributes()->attach($attribute->id);
|
||||
}
|
||||
|
||||
foreach (array_permutation($super_attributes) as $permutation) {
|
||||
$this->createVarient($product, $permutation);
|
||||
}
|
||||
}
|
||||
|
||||
return $product;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function createVarient($product, $permutation)
|
||||
{
|
||||
$varient = $this->model->create([
|
||||
'parent_id' => $product->id,
|
||||
'type' => 'simple',
|
||||
'attribute_family_id' => $product->attribute_family_id,
|
||||
'sku' => $product->sku . '-varient-' . implode('-', $permutation),
|
||||
]);
|
||||
|
||||
foreach($permutation as $attributeId => $optionId) {
|
||||
$this->attributeValue->create([
|
||||
'product_id' => $varient->id,
|
||||
'attribute_id' => $attributeId,
|
||||
'value' => $optionId
|
||||
]);
|
||||
}
|
||||
|
||||
return $varient;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
</div>
|
||||
<div class="dropdown-list bottom-right" style="display: none;">
|
||||
<div class="dropdown-container">
|
||||
<label>Account</label>
|
||||
<ul>
|
||||
<li><a href="{{ route('customer.session.index') }}">Sign In</a></li>
|
||||
<li><a href="{{ route('customer.register.index') }}">Sign Up</a></li>
|
||||
|
|
@ -56,7 +57,7 @@
|
|||
</ul>
|
||||
<ul class="ham-dropdown-container">
|
||||
<li class="ham-dropdown">
|
||||
|
||||
{{-- use this section for the dropdown of the hamburger menu --}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -71,6 +72,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="header-bottom">
|
||||
@include('shop::store.header.nav-menu.navmenu')
|
||||
@include('shop::store.header.nav-menu.navmenu')
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,14 +1 @@
|
|||
{{-- <ul class="menu-bar">
|
||||
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
|
||||
<li>
|
||||
<img class="icon" src="vendor/webkul/shop/assets/images/offer-zone.svg" style="margin-right:5px;" />Offer Zone
|
||||
</li>
|
||||
<li>Men</li>
|
||||
<li>Women</li>
|
||||
<li>Kids</li>
|
||||
<li>Accessories</li>
|
||||
<li>Home & Living</li>
|
||||
|
||||
</ul> --}}
|
||||
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
|
||||
{{-- <nav-view items='@json($categories)'></nav-view> --}}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
{{-- suitable for string columns --}}
|
||||
<li class="filter-condition-dropdown-string">
|
||||
<select class="control filter-condition-select-string">
|
||||
<option selected disabled>Select Condition</option>
|
||||
<option selected disabled value="">Select Condition</option>
|
||||
<option value="like">Contains</option>
|
||||
<option value="nlike">Does not contains</option>
|
||||
<option value="eq">Is equal to</option>
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
{{-- suitable for numeric columns --}}
|
||||
<li class="filter-condition-dropdown-number">
|
||||
<select class="control filter-condition-select-number">
|
||||
<option selected disabled>Select Condition</option>
|
||||
<option selected disabled value="">Select Condition</option>
|
||||
<option value="eq">Is equal to</option>
|
||||
<option value="neqs">Is not equal to</option>
|
||||
<option value="gt">Greater than</option>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
{{-- suitable for date/time columns --}}
|
||||
<li class="filter-condition-dropdown-datetime">
|
||||
<select class="control filter-condition-select-datetime">
|
||||
<option selected disabled>Select Condition</option>
|
||||
<option selected disabled value="">Select Condition</option>
|
||||
<option value="eq">Is equal to</option>
|
||||
<option value="neqs">Is not equal to</option>
|
||||
<option value="gt">Greater than</option>
|
||||
|
|
@ -77,19 +77,21 @@
|
|||
</li>
|
||||
{{-- Response fields based on the type of columns to be filtered --}}
|
||||
<li class="filter-response-string">
|
||||
<input type="text" class="control response-string" placeholder="Value here" />
|
||||
<input type="text" class="control response-string" placeholder="String Value here" value=""/>
|
||||
</li>
|
||||
<li class="filter-response-boolean">
|
||||
<select class="control select-boolean">
|
||||
<option selected disabled value="null">Select Condition</option>
|
||||
<option value="true">Is True</option>
|
||||
<option value="false">Is False</option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="filter-response-datetime">
|
||||
{{-- use flatpickr here --}}
|
||||
<input type="datetime-local" class="control response-datetime" placeholder="Value here" />
|
||||
</li>
|
||||
<li class="filter-response-number">
|
||||
<input type="text" class="control response-number" placeholder="Value here" />
|
||||
<input type="text" class="control response-number" placeholder="Numeric Value here" value=""/>
|
||||
</li>
|
||||
<li>
|
||||
<button class="btn btn-sm btn-primary apply-filter">Apply</button>
|
||||
|
|
|
|||
|
|
@ -270,98 +270,104 @@
|
|||
/*validate the conditions here and do the replacements and
|
||||
push here in the all filters array*/
|
||||
var obj1 = {};
|
||||
if(column == "" || condition == "" || response == ""){
|
||||
alert("Please mention all the fields for column, condition and match params for proper functioning");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(allFilters1.length>0) {
|
||||
//case for repeated filter
|
||||
|
||||
if(allFilters1.length>0) {
|
||||
//case for repeated filter
|
||||
|
||||
if(column != "sort" && column != "search") {
|
||||
filter_repeated = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response)
|
||||
{
|
||||
filter_repeated = 1;
|
||||
return false;
|
||||
if(column != "sort" && column != "search") {
|
||||
filter_repeated = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response)
|
||||
{
|
||||
filter_repeated = 1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(filter_repeated == 0) {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
if(filter_repeated == 0) {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
if(column == "sort") {
|
||||
sort_exists = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "sort") {
|
||||
if(column == "sort") {
|
||||
sort_exists = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "sort") {
|
||||
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response){
|
||||
if(response=="asc"){
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "desc";
|
||||
allFilters1[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
else {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "asc";
|
||||
allFilters1[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
|
||||
if(allFilters1[j].column==column && allFilters1[j].cond==condition && allFilters1[j].val==response){
|
||||
if(response=="asc"){
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "desc";
|
||||
allFilters1[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
else {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = "asc";
|
||||
allFilters1[j].val = response;
|
||||
allFilters1[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
}
|
||||
}
|
||||
if(column == "search") {
|
||||
search_found = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = response;
|
||||
allFilters1[j].label = clabel;
|
||||
makeURL();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(column == "search") {
|
||||
search_found = 0;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
allFilters1[j].column = column;
|
||||
allFilters1[j].cond = condition;
|
||||
allFilters1[j].val = response;
|
||||
allFilters1[j].label = clabel;
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
search_found = 1;
|
||||
}
|
||||
}
|
||||
if(search_found == 0) {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
}
|
||||
for(j=0;j<allFilters1.length;j++) {
|
||||
if(allFilters1[j].column == "search") {
|
||||
search_found = 1;
|
||||
}
|
||||
}
|
||||
if(search_found == 0) {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
} else {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
} else {
|
||||
obj1.column = column;
|
||||
obj1.cond = condition;
|
||||
obj1.val = response;
|
||||
obj1.label = clabel;
|
||||
allFilters1.push(obj1);
|
||||
obj1 = {};
|
||||
makeURL();
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,36 +1,84 @@
|
|||
<div class="table">
|
||||
|
||||
<table class="{{ $css->table }}">
|
||||
|
||||
<thead>
|
||||
|
||||
<tr class="mass-action" style="display: none;">
|
||||
|
||||
<th colspan="{{ count($columns)+1 }}">
|
||||
|
||||
<div class="xyz">
|
||||
|
||||
<span class="massaction-remove">
|
||||
<span class="icon checkbox-dash-icon"></span>
|
||||
</span>
|
||||
{{-- <div class="selected-items"></div> --}}
|
||||
@foreach($massoperations as $massoperation) {{--
|
||||
<h3>{{ $massoperation['label'] }}</h3> --}} @if($massoperation['type'] == "button")
|
||||
<form onsubmit="return confirm('Are You Sure?');" @if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" ) method="{{ strtoupper($massoperation['method']) }}"
|
||||
@else method="POST" @endif action="{{ $massoperation['route'] }}">
|
||||
{{ csrf_field() }} @if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST") @method($massoperation['method'])
|
||||
|
||||
@foreach($massoperations as $massoperation)
|
||||
|
||||
@if($massoperation['type'] == "button")
|
||||
|
||||
<form onsubmit="return confirm('Are You Sure?');"
|
||||
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation['method'])=="POST" )
|
||||
method="{{ strtoupper($massoperation['method']) }}"
|
||||
|
||||
@else
|
||||
method="POST"
|
||||
@endif
|
||||
|
||||
action="{{ $massoperation['route'] }}">
|
||||
|
||||
{{ csrf_field() }}
|
||||
|
||||
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
|
||||
|
||||
@method($massoperation['method'])
|
||||
|
||||
@endif
|
||||
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
|
||||
|
||||
</form>
|
||||
|
||||
@elseif($massoperation['type'] == "select")
|
||||
|
||||
<form
|
||||
@if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" )
|
||||
|
||||
method="{{ strtoupper($massoperation['method']) }}"
|
||||
|
||||
@else
|
||||
method="POST"
|
||||
|
||||
@endif
|
||||
|
||||
action="{{ $massoperation['route'] }}">
|
||||
{{ csrf_field() }}
|
||||
@if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST")
|
||||
|
||||
@method($massoperation['method'])
|
||||
|
||||
@endif
|
||||
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
|
||||
<select name="choices">
|
||||
|
||||
@foreach($massoperation['options'] as $option)
|
||||
|
||||
<option>{{ $option }}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
|
||||
|
||||
</form>
|
||||
@endif
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
|
||||
</form>
|
||||
@elseif($massoperation['type'] == "select")
|
||||
<form @if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" ) method="{{ strtoupper($massoperation['method']) }}"
|
||||
@else method="POST" @endif action="{{ $massoperation['route'] }}">
|
||||
{{ csrf_field() }} @if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST") @method($massoperation['method'])
|
||||
@endif
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
<select name="choices">
|
||||
@foreach($massoperation['options'] as $option)
|
||||
<option>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
|
||||
</form>
|
||||
@endif @endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
|
@ -41,14 +89,13 @@
|
|||
<label class="checkbox-view" for="checkbox"></label>
|
||||
</span>
|
||||
</th>
|
||||
@foreach ($columns as $column)
|
||||
@if($column->sortable == "true")
|
||||
<th class="labelled-col grid_head sort-head" data-column-name="{{ $column->name }}" data-column-label="{{ $column->label }}" data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
|
||||
</th>
|
||||
@else
|
||||
<th class="labelled-col grid_head" data-column-name="{{ $column->name }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
@foreach ($columns as $column) @if($column->sortable == "true")
|
||||
<th class="labelled-col grid_head sort-head" data-column-name="{{ $column->name }}" data-column-label="{{ $column->label }}"
|
||||
data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
|
||||
</th>
|
||||
@else
|
||||
<th class="labelled-col grid_head" data-column-name="{{ $column->name }}" data-column-label="{{ $column->label }}">{!! $column->sorting() !!}</th>
|
||||
@endif @endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $css->tbody }}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue