diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index 640e10ebd..982033ebc 100644 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -29,10 +29,10 @@ class AttributeDataGrid 'name' => 'Attributes', 'table' => 'attributes', 'select' => 'id', - 'perpage' => 10, - 'aliased' => false, //use this with false as default and true in case of joins + 'perpage' => 5, + 'aliased' => true, - 'massoperations' =>[ + 'massoperations' => [ [ 'route' => route('admin.datagrid.delete'), 'method' => 'DELETE', @@ -55,20 +55,11 @@ class AttributeDataGrid ], ], - 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] - ], + 'join' => [], //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 'id', 'alias' => 'attributeId', @@ -95,73 +86,106 @@ class AttributeDataGrid 'alias' => 'attributeType', 'type' => 'string', 'label' => 'Type', - 'sortable' => true, + 'sortable' => false, ], [ 'name' => 'is_required', 'alias' => 'attributeIsRequired', 'type' => 'string', 'label' => 'Required', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'is_unique', 'alias' => 'attributeIsUnique', 'type' => 'string', 'label' => 'Unique', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'value_per_locale', 'alias' => 'attributeValuePerLocale', 'type' => 'string', 'label' => 'ValuePerLocale', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], [ 'name' => 'value_per_channel', 'alias' => 'attributeValuePerChannel', 'type' => 'string', 'label' => 'ValuePerChannel', - 'sortable' => true, + 'sortable' => false, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], - ], 'filterable' => [ - // [ - // 'column' => 'id', - // 'alias' => 'attribute_family_id', - // 'type' => 'number', - // 'label' => 'ID', - // ], - // [ - // 'column' => 'code', - // 'alias' => 'attribute_family_code', - // 'type' => 'string', - // 'label' => 'Code', - // ], - // [ - // 'column' => 'name', - // 'alias' => 'attribute_family_name', - // 'type' => 'string', - // 'label' => 'Name', - // ], + [ + 'column' => 'id', + 'alias' => 'attributeId', + 'type' => 'number', + 'label' => 'ID', + ], + [ + 'column' => 'code', + 'alias' => 'attributeCode', + 'type' => 'string', + 'label' => 'Code', + ], + [ + 'column' => 'admin_name', + 'alias' => 'attributeAdminName', + 'type' => 'string', + 'label' => 'AdminName', + ], + [ + 'column' => 'type', + 'alias' => 'attributeType', + 'type' => 'string', + 'label' => 'Type', + ], ], //don't use aliasing in case of searchables - 'searchable' => [ - // [ - // 'column' => 'name', - // 'type' => 'string', - // 'label' => 'Name', - // ], - // [ - // 'column' => 'code', - // 'type' => 'string', - // 'label' => 'Code', - // ], + [ + 'column' => 'code', + 'alias' => 'attributeCode', + 'type' => 'string', + ], + [ + 'column' => 'admin_name', + 'alias' => 'attributeAdminName', + 'type' => 'string', + ], + [ + 'column' => 'type', + 'alias' => 'attributeType', + 'type' => 'string', + ], ], //list of viable operators that will be used @@ -176,16 +200,14 @@ class AttributeDataGrid 'like' => "like", 'nlike' => "not like", ], - // 'css' => [] + // 'css' => [] ]); } public function render() { - return $this->createAttributeDataGrid()->render(); - } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 5f85e2f2d..08012cfb2 100644 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -69,7 +69,6 @@ class CategoryDataGrid 'condition' => '=', 'secondaryKey' => 'cta.category_id', ], - ], //use aliasing on secodary columns if join is performed @@ -105,44 +104,56 @@ class CategoryDataGrid 'type' => 'string', 'label' => 'Visible in Menu', 'sortable' => true, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, ], ], 'filterable' => [ - // [ - // 'column' => 'id', - // 'alias' => 'attribute_family_id', - // 'type' => 'number', - // 'label' => 'ID', - // ], - // [ - // 'column' => 'code', - // 'alias' => 'attribute_family_code', - // 'type' => 'string', - // 'label' => 'Code', - // ], - // [ - // 'column' => 'name', - // 'alias' => 'attribute_family_name', - // 'type' => 'string', - // 'label' => 'Name', - // ], + [ + 'column' => 'cat.id', + 'alias' => 'catID', + 'type' => 'number', + 'label' => 'Category ID', + ], [ + 'column' => 'ct.name', + 'alias' => 'catName', + 'type' => 'string', + 'label' => 'Category Name', + ], [ + 'column' => 'cta.name', + 'alias' => 'parentName', + 'type' => 'string', + 'label' => 'Parent Name', + ], [ + 'column' => 'cat.status', + 'alias' => 'catStatus', + 'type' => 'string', + 'label' => 'Visible in Menu', + ], ], //don't use aliasing in case of searchables 'searchable' => [ - // [ - // 'column' => 'name', - // 'type' => 'string', - // 'label' => 'Name', - // ], - // [ - // 'column' => 'code', - // 'type' => 'string', - // 'label' => 'Code', - // ], + [ + 'column' => 'cat.id', + 'type' => 'number', + 'label' => 'Category ID', + ], [ + 'column' => 'ct.name', + 'type' => 'string', + 'label' => 'Category Name', + ], [ + 'column' => 'cat.status', + 'type' => 'string', + 'label' => 'Visible in Menu', + ] ], //list of viable operators that will be used @@ -158,14 +169,11 @@ class CategoryDataGrid 'nlike' => "not like", ], // 'css' => [] - ]); - } public function render() { - return $this->createCategoryDataGrid()->render(); } diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 592b0f5b4..070694ca2 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -30,14 +30,14 @@ class CustomerDataGrid 'table' => 'customers', 'select' => 'id', 'perpage' => 10, - 'aliased' => false, //use this with false as default and true in case of joins + 'aliased' => true, //use this with false as default and true in case of joins 'massoperations' =>[ [ 'route' => route('admin.datagrid.delete'), 'method' => 'DELETE', 'label' => 'Delete', - 'type' => 'button', + 'type' => 'button', //select || button only ], ], @@ -56,53 +56,45 @@ class CustomerDataGrid ], 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] + ], //use aliasing on secodary columns if join is performed - 'columns' => [ - [ 'name' => 'id', - 'alias' => 'customerId', + 'alias' => 'ID', 'type' => 'number', - 'label' => 'ID', + 'label' => 'Customer ID', 'sortable' => true, ], [ 'name' => 'first_name', - 'alias' => 'customerFirstName', + 'alias' => 'FirstName', 'type' => 'string', - 'label' => 'Name', - 'sortable' => true, + 'label' => 'Customer First Name', + 'sortable' => false, ], [ 'name' => 'email', - 'alias' => 'customerEmail', + 'alias' => 'Email', 'type' => 'string', - 'label' => 'Email', - 'sortable' => true, + 'label' => 'Customer E-Mail', + 'sortable' => false, ], [ 'name' => 'phone', - 'alias' => 'customerPhone', + 'alias' => 'Phone', 'type' => 'number', - 'label' => 'Phone', + 'label' => 'Customer Phone', 'sortable' => true, ], [ 'name' => 'customer_group_id', - 'alias' => 'customerGroupId', + 'alias' => 'CustomerGroupId', 'type' => 'number', 'label' => 'Customer Group', - 'sortable' => true, + 'sortable' => false, ], ], @@ -111,49 +103,31 @@ class CustomerDataGrid 'filterable' => [ [ - 'name' => 'id', - 'alias' => 'customerId', + 'column' => 'id', + 'alias' => 'ID', 'type' => 'number', - 'label' => 'ID', + 'label' => 'Customer ID', ], [ - 'name' => 'first_name', - 'alias' => 'customerFirstName', + 'column' => 'first_name', + 'alias' => 'FirstName', 'type' => 'string', - 'label' => 'Name', - ], - [ - 'name' => 'email', - 'alias' => 'customerEmail', - 'type' => 'string', - 'label' => 'Email', - ], - [ - 'name' => 'phone', - 'alias' => 'customerPhone', - 'type' => 'number', - 'label' => 'Phone', - ], - [ - 'name' => 'customer_group_id', - 'alias' => 'customerGroupId', - 'type' => 'string', - 'label' => 'Customer Group', - ], + 'label' => 'Customer First Name', + ] ], //don't use aliasing in case of searchables 'searchable' => [ [ - 'column' => 'first_name', + 'column' => 'FirstName', 'type' => 'string', - 'label' => 'Title', + 'label' => 'Customer First Name', ], [ 'column' => 'email', 'type' => 'string', - 'label' => 'Rating', + 'label' => 'Customer E-Mail', ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index fff921c47..2360e9e89 100644 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -19,7 +19,7 @@ class CustomerReviewDataGrid * The CustomerReviewDataGrid * implementation. * - * @var ReviewsDataGrid + * @var CustomerReviewsDataGrid * for Reviews */ @@ -57,13 +57,6 @@ class CustomerReviewDataGrid ], 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] ], //use aliasing on secodary columns if join is performed @@ -76,67 +69,51 @@ class CustomerReviewDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'title', 'alias' => 'titleName', 'type' => 'string', 'label' => 'Title', 'sortable' => true, - ], - [ - 'name' => 'rating', - 'alias' => 'productRating', - 'type' => 'number', - 'label' => 'Rating', - 'sortable' => true, - ], - [ + ], [ 'name' => 'comment', 'alias' => 'productComment', 'type' => 'string', 'label' => 'Comment', 'sortable' => true, - ], - [ + ], [ 'name' => 'status', 'alias' => 'reviewStatus', 'type' => 'number', 'label' => 'Status', 'sortable' => true, ], - ], //don't use aliasing in case of filters - 'filterable' => [ [ - 'name' => 'id', + 'column' => 'id', 'alias' => 'reviewId', 'type' => 'number', 'label' => 'ID', - ], - [ - 'name' => 'title', + ], [ + 'column' => 'title', 'alias' => 'titleName', 'type' => 'string', 'label' => 'Title', - ], - [ - 'name' => 'rating', + ], [ + 'column' => 'rating', 'alias' => 'productRating', 'type' => 'number', 'label' => 'Rating', - ], - [ - 'name' => 'comment', + ], [ + 'column' => 'comment', 'alias' => 'productComment', 'type' => 'string', 'label' => 'Comment', - ], - [ - 'name' => 'status', + ], [ + 'column' => 'status', 'alias' => 'reviewStatus', 'type' => 'string', 'label' => 'Status', @@ -144,14 +121,12 @@ class CustomerReviewDataGrid ], //don't use aliasing in case of searchables - 'searchable' => [ [ 'column' => 'title', 'type' => 'string', 'label' => 'Title', - ], - [ + ], [ 'column' => 'rating', 'type' => 'number', 'label' => 'Rating', diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index 876587c00..85d091a3b 100644 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -64,7 +64,6 @@ class InventorySourcesDataGrid ], //use aliasing on secodary columns if join is performed - 'columns' => [ [ @@ -73,34 +72,36 @@ class InventorySourcesDataGrid 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 'code', 'alias' => 'inventoryCode', 'type' => 'string', 'label' => 'Code', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'name', 'alias' => 'inventoryName', 'type' => 'string', 'label' => 'Name', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'priority', 'alias' => 'inventoryPriority', 'type' => 'string', 'label' => 'Priority', 'sortable' => true, - ], - [ + ], [ 'name' => 'status', 'alias' => 'inventoryStatus', 'type' => 'string', 'label' => 'Status', 'sortable' => true, + 'wrapper' => function ($value) { + if($value == 0) + return "In Active"; + else + return "Active"; + }, ], ], diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php new file mode 100644 index 000000000..5324637a4 --- /dev/null +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -0,0 +1,179 @@ + @prashant-webkul + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ + +class OrderDataGrid +{ + /** + * The Data Grid implementation. + * + * @var AttributeDataGrid + * for countries + */ + + public function createCategoryDataGrid() + { + + return DataGrid::make([ + 'name' => 'Orders', + 'table' => 'orders as ord', + 'select' => 'ord.id', + 'perpage' => 5, + 'aliased' => true, //use this with false as default and true in case of joins + + 'massoperations' =>[ + [ + 'route' => route('admin.datagrid.delete'), + 'method' => 'DELETE', + 'label' => 'Delete', + 'type' => 'button', + ], + ], + + 'actions' => [ + [ + 'type' => 'Edit', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon pencil-lg-icon', + ], [ + 'type' => 'Delete', + 'route' => route('admin.datagrid.delete'), + 'confirm_text' => 'Do you really want to do this?', + 'icon' => 'icon trash-icon', + ], + ], + + 'join' => [ + [ + 'join' => 'leftjoin', + 'table' => 'category_translations as ct', + 'primaryKey' => 'cat.id', + 'condition' => '=', + 'secondaryKey' => 'ct.category_id', + ], [ + 'join' => 'leftjoin', + 'table' => 'category_translations as cta', + 'primaryKey' => 'cat.parent_id', + 'condition' => '=', + 'secondaryKey' => 'cta.category_id', + ], + ], + + //use aliasing on secodary columns if join is performed + + 'columns' => [ + [ + 'name' => 'cat.id', + 'alias' => 'catID', + 'type' => 'number', + 'label' => 'Category ID', + 'sortable' => true, + ], [ + 'name' => 'ct.name', + 'alias' => 'catName', + 'type' => 'string', + 'label' => 'Category Name', + 'sortable' => false, + ], [ + 'name' => 'cat.position', + 'alias' => 'catPosition', + 'type' => 'string', + 'label' => 'Category Position', + 'sortable' => false, + ], [ + 'name' => 'cta.name', + 'alias' => 'parentName', + 'type' => 'string', + 'label' => 'Parent Name', + 'sortable' => true, + ], [ + 'name' => 'cat.status', + 'alias' => 'catStatus', + 'type' => 'string', + 'label' => 'Visible in Menu', + 'sortable' => true, + 'wrapper' => function ($value) { + if($value == 0) + return "False"; + else + return "True"; + }, + ], + + ], + + 'filterable' => [ + [ + 'column' => 'cat.id', + 'alias' => 'catID', + 'type' => 'number', + 'label' => 'Category ID', + ], [ + 'column' => 'ct.name', + 'alias' => 'catName', + 'type' => 'string', + 'label' => 'Category Name', + ], [ + 'column' => 'cta.name', + 'alias' => 'parentName', + 'type' => 'string', + 'label' => 'Parent Name', + ], [ + 'column' => 'cat.status', + 'alias' => 'catStatus', + 'type' => 'string', + 'label' => 'Visible in Menu', + ], + ], + + //don't use aliasing in case of searchables + + 'searchable' => [ + [ + 'column' => 'cat.id', + 'type' => 'number', + 'label' => 'Category ID', + ], [ + 'column' => 'ct.name', + 'type' => 'string', + 'label' => 'Category Name', + ], [ + 'column' => 'cat.status', + 'type' => 'string', + 'label' => 'Visible in Menu', + ] + ], + + //list of viable operators that will be used + 'operators' => [ + 'eq' => "=", + 'lt' => "<", + 'gt' => ">", + 'lte' => "<=", + 'gte' => ">=", + 'neqs' => "<>", + 'neqn' => "!=", + 'like' => "like", + 'nlike' => "not like", + ], + // 'css' => [] + ]); + } + + public function render() + { + return $this->createCategoryDataGrid()->render(); + + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 25cf5249d..74e236511 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -129,25 +129,25 @@ class ProductDataGrid 'filterable' => [ //column, type, and label [ - 'name' => 'prods.id', + 'column' => 'prods.id', 'alias' => 'productID', 'type' => 'number', 'label' => 'ID', ], [ - 'name' => 'prods.sku', + 'column' => 'prods.sku', 'alias' => 'productCode', 'type' => 'string', 'label' => 'SKU', ], [ - 'name' => 'attfam.name', + 'column' => 'attfam.name', 'alias' => 'FamilyName', 'type' => 'string', 'label' => 'Family Name', ], [ - 'name' => 'pi.qty', + 'column' => 'pi.qty', 'alias' => 'ProductQuantity', 'type' => 'number', 'label' => 'Product Quatity', diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index 361c6cb43..759fb0f45 100644 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -67,28 +67,25 @@ class SliderDataGrid //use aliasing on secodary columns if join is performed 'columns' => [ - [ 'name' => 's.id', 'alias' => 'sliderId', 'type' => 'number', 'label' => 'ID', 'sortable' => true, - ], - [ + ], [ 'name' => 's.title', 'alias' => 'sliderTitle', 'type' => 'string', 'label' => 'title', - ], - [ + 'sortable' => false + ], [ 'name' => 's.channel_id', 'alias' => 'channelId', 'type' => 'string', 'label' => 'Channel ID', - 'sortable' => true, - ], - [ + 'sortable' => false, + ], [ 'name' => 'c.name', 'alias' => 'channelName', 'type' => 'string', @@ -98,41 +95,31 @@ class SliderDataGrid ], //don't use aliasing in case of filters - 'filterable' => [ [ - 'column' => 'id', - 'alias' => 'locale_id', + 'column' => 's.id', + 'alias' => 'sliderId', 'type' => 'number', - 'label' => 'ID', - ], - [ - 'column' => 'code', - 'alias' => 'locale_code', + 'label' => 'ID' + ], [ + 'column' => 's.title', + 'alias' => 'SliderTitle', 'type' => 'string', - 'label' => 'Code', - ], - [ - 'column' => 'name', - 'alias' => 'locale_name', - 'type' => 'string', - 'label' => 'Name', + 'label' => 'Slider Title' ], ], //don't use aliasing in case of searchables - 'searchable' => [ - // [ - // 'column' => 'name', - // 'type' => 'string', - // 'label' => 'Name', - // ], - // [ - // 'column' => 'code', - // 'type' => 'string', - // 'label' => 'Code', - // ], + [ + 'column' => 's.id', + 'type' => 'number', + 'label' => 'ID' + ], [ + 'column' => 's.title', + 'type' => 'string', + 'label' => 'Slider Title' + ] ], //list of viable operators that will be used @@ -148,9 +135,7 @@ class SliderDataGrid 'nlike' => "not like", ], // 'css' => [] - ]); - } public function render() diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index e51d10f11..f93464664 100644 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -24,7 +24,6 @@ class TaxRateDataGrid { return DataGrid::make([ - 'name' => 'Tax Rates', 'table' => 'tax_rates as tr', 'select' => 'tr.id', @@ -64,21 +63,13 @@ class TaxRateDataGrid 'icon' => 'icon trash-icon', ], ], - 'join' => [ - // [ - // 'join' => 'leftjoin', - // 'table' => 'roles as r', - // 'primaryKey' => 'u.role_id', - // 'condition' => '=', - // 'secondaryKey' => 'r.id', - // ] - ], + 'join' => [], //use aliasing on secodary columns if join is performed 'columns' => [ [ 'name' => 'tr.id', - 'alias' => 'ID', + 'alias' => 'id', 'type' => 'number', 'label' => 'ID', 'sortable' => true, @@ -90,7 +81,7 @@ class TaxRateDataGrid 'label' => 'Identifier', 'sortable' => true, // 'wrapper' => function ($value, $object) { - // return '' . $object->Name . ''; + // return '' . $object->identifier . ''; // }, ], [ @@ -119,32 +110,27 @@ class TaxRateDataGrid //don't use aliasing in case of filters 'filterable' => [ [ - 'name' => 'tr.id', + 'column' => 'tr.id', 'alias' => 'ID', 'type' => 'number', 'label' => 'ID', - ], - [ - 'name' => 'tr.identifier', + ], [ + 'column' => 'tr.identifier', 'alias' => 'identifier', 'type' => 'string', 'label' => 'Identifier', - ], - [ - 'name' => 'tr.state', + ], [ + 'column' => 'tr.state', 'alias' => 'state', 'type' => 'string', 'label' => 'State', - ], - [ - 'name' => 'tr.country', + ], [ + 'column' => 'tr.country', 'alias' => 'country', 'type' => 'string', 'label' => 'Country', - ], - - [ - 'name' => 'tr.tax_rate', + ], [ + 'column' => 'tr.tax_rate', 'alias' => 'tax_rate', 'type' => 'number', 'label' => 'Tax Rate', @@ -157,22 +143,6 @@ class TaxRateDataGrid 'type' => 'string', 'label' => 'Identifier', ], - [ - 'column' => 'tr.state', - 'type' => 'string', - 'label' => 'State', - ], - [ - 'column' => 'tr.country', - 'type' => 'string', - 'label' => 'Country', - ], - - [ - 'column' => 'tr.tax_rate', - 'type' => 'number', - 'label' => 'Tax Rate', - ], ], 'operators' => [ 'eq' => "=", diff --git a/packages/Webkul/Admin/src/Exceptions/Handler.php b/packages/Webkul/Admin/src/Exceptions/Handler.php new file mode 100644 index 000000000..918aca539 --- /dev/null +++ b/packages/Webkul/Admin/src/Exceptions/Handler.php @@ -0,0 +1,42 @@ +getStatusCode(); + + if(strpos($_SERVER['REQUEST_URI'], 'admin') !== false){ + return response(view('admin::errors.'.$statusCode, [ + 'msg' => $exception->getMessage(), + 'code' => $statusCode + ]), $statusCode); + }else { + return response(view('shop::errors.'.$statusCode, [ + 'msg' => $exception->getMessage(), + 'code' => $statusCode + ]), $statusCode); + } + + } + + return parent::render($request, $exception); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Http/Controllers/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php similarity index 98% rename from packages/Webkul/Core/src/Http/Controllers/CustomerController.php rename to packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 17c8ead1d..f883e4283 100644 --- a/packages/Webkul/Core/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -1,6 +1,6 @@ ['web']], function () { Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index'); //Customers Management Routes - - Route::get('customers', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config', [ + Route::get('customer', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config', [ 'view' => 'admin::customers.index' ])->name('admin.customer.index'); - Route::get('customers/orders', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config',[ + Route::get('customer/orders', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@index')->defaults('_config',[ 'view' => 'admin::customers.orders.index' ])->name('admin.customer.orders.index'); - Route::get('customers/create', 'Webkul\Core\Http\Controllers\CustomerController@create')->defaults('_config',[ + Route::get('customer/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@create')->defaults('_config',[ 'view' => 'admin::customers.create' ])->name('admin.customer.create'); - Route::post('customers/create', 'Webkul\Core\Http\Controllers\CustomerController@store')->defaults('_config',[ + Route::post('customer/create', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@store')->defaults('_config',[ 'redirect' => 'admin.customer.index' ])->name('admin.customer.store'); - Route::get('customers/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@edit')->defaults('_config',[ + Route::get('customer/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@edit')->defaults('_config',[ 'view' => 'admin::customers.edit' ])->name('admin.customer.edit'); - Route::put('customers/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@update')->defaults('_config', [ + Route::put('customer/edit/{id}', 'Webkul\Admin\Http\Controllers\Customer\CustomerController@update')->defaults('_config', [ 'redirect' => 'admin.customer.index' ])->name('admin.customer.update'); - Route::get('customers/delete/{id}', 'Webkul\Core\Http\Controllers\CustomerController@destroy')->name('admin.customer.delete'); + Route::get('customers/delete/{id}', 'Webkul\Admin\Http\Controllers\CustomerController@destroy')->name('admin.customer.delete'); + Route::get('reviews', 'Webkul\Product\Http\Controllers\ReviewController@index')->defaults('_config',[ 'view' => 'admin::customers.review.index' @@ -79,6 +79,7 @@ Route::group(['middleware' => ['web']], function () { 'redirect' => 'admin.customer.review.index' ])->name('admin.customer.review.update'); + // Sales Routes Route::prefix('sales')->group(function () { // Sales Order Routes diff --git a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php index 5e94fd48d..1fe463fbb 100644 --- a/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/AdminServiceProvider.php @@ -6,6 +6,8 @@ use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Blade; use Webkul\Admin\Providers\EventServiceProvider; +use Illuminate\Contracts\Debug\ExceptionHandler; +use Webkul\Admin\Exceptions\Handler; class AdminServiceProvider extends ServiceProvider { @@ -29,6 +31,11 @@ class AdminServiceProvider extends ServiceProvider $this->composeView(); $this->app->register(EventServiceProvider::class); + + $this->app->bind( + ExceptionHandler::class, + Handler::class + ); } /** diff --git a/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php index 223923435..4c26d509b 100644 --- a/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/catalog/categories/create.blade.php @@ -6,8 +6,8 @@ @section('content')
- -
+ + - +
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/errors/403.blade.php b/packages/Webkul/Admin/src/Resources/views/errors/403.blade.php new file mode 100644 index 000000000..b351a4191 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/errors/403.blade.php @@ -0,0 +1,30 @@ +@extends('admin::layouts.content') + +@section('page_title') + +@stop + +@section('content') +
+ +
+ +
+ +
{{ $code }}
+ +
Page Not Found
+ +
The Page you are looking for doesnt exist or have secrately escaped;head backm to home and make a fresh move again.
+ + GO TO HOME + +
+ +
+ +
+ +
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php b/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php index 3a46d37a5..b351a4191 100644 --- a/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/errors/404.blade.php @@ -1,13 +1,30 @@ @extends('admin::layouts.content') @section('page_title') - {{ __('admin::app.catalog.categories.edit-title') }} + @stop @section('content') -
+
+
+
+ +
{{ $code }}
+ +
Page Not Found
+ +
The Page you are looking for doesnt exist or have secrately escaped;head backm to home and make a fresh move again.
+ + GO TO HOME + +
+ +
+ +
@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/errors/500.blade.php b/packages/Webkul/Admin/src/Resources/views/errors/500.blade.php new file mode 100644 index 000000000..b351a4191 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/errors/500.blade.php @@ -0,0 +1,30 @@ +@extends('admin::layouts.content') + +@section('page_title') + +@stop + +@section('content') +
+ +
+ +
+ +
{{ $code }}
+ +
Page Not Found
+ +
The Page you are looking for doesnt exist or have secrately escaped;head backm to home and make a fresh move again.
+ + GO TO HOME + +
+ +
+ +
+ +
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php index e7a25358c..a47db30c1 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/master.blade.php @@ -13,14 +13,14 @@ @yield('head') @yield('css') - + - +
- + @include ('admin::layouts.nav-top') @include ('admin::layouts.nav-left') @@ -44,8 +44,10 @@ @endif window.serverErrors = []; - @if (count($errors)) - window.serverErrors = @json($errors->getMessages()); + @if(isset($errors)) + @if (count($errors)) + window.serverErrors = @json($errors->getMessages()); + @endif @endif diff --git a/packages/Webkul/Admin/src/Resources/views/layouts/nav-top.blade.php b/packages/Webkul/Admin/src/Resources/views/layouts/nav-top.blade.php index 36a6fc1bd..a52a6a85d 100644 --- a/packages/Webkul/Admin/src/Resources/views/layouts/nav-top.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/layouts/nav-top.blade.php @@ -14,7 +14,7 @@