Merge pull request #6 from bagisto/rahul

Rahul
This commit is contained in:
JItendra Singh 2018-09-13 16:48:55 +05:30 committed by GitHub
commit ba90c53d33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
182 changed files with 12806 additions and 656 deletions

View File

@ -38,7 +38,8 @@
"webkul/laravel-category": "self.version",
"webkul/laravel-product": "self.version",
"webkul/laravel-shop": "self.version",
"webkul/laravel-theme": "self.version"
"webkul/laravel-theme": "self.version",
"webkul/laravel-shipping": "self.version"
},
"autoload": {
"classmap": [
@ -57,7 +58,9 @@
"Webkul\\Customer\\": "packages/Webkul/Customer/src",
"Webkul\\Inventory\\": "packages/Webkul/Inventory/src",
"Webkul\\Product\\": "packages/Webkul/Product/src",
"Webkul\\Theme\\": "packages/Webkul/Theme/src"
"Webkul\\Theme\\": "packages/Webkul/Theme/src",
"Webkul\\Cart\\": "packages/Webkul/Cart/src",
"Webkul\\Shipping\\": "packages/Webkul/Shipping/src"
}
},
"autoload-dev": {

View File

@ -172,6 +172,8 @@ return [
//Laravel Intervention
Intervention\Image\ImageServiceProvider::class,
//Repository
Prettus\Repository\Providers\RepositoryServiceProvider::class,
//Webkul packages
@ -187,7 +189,9 @@ return [
Webkul\Product\Providers\ProductServiceProvider::class,
Webkul\Shop\Providers\ShopServiceProvider::class,
Webkul\Customer\Providers\CustomerServiceProvider::class,
Webkul\Theme\Providers\ThemeServiceProvider::class
Webkul\Theme\Providers\ThemeServiceProvider::class,
Webkul\Cart\Providers\CartServiceProvider::class,
Webkul\Shipping\Providers\ShippingServiceProvider::class,
],
/*

51
config/carrier.php Normal file
View File

@ -0,0 +1,51 @@
<?php
return [
'flatrate' => [
[
'code' => 'flatrate_one',
'title' => 'Flatrate One',
'name' => 'fixed 20% discount for today',
'description' => 'this is a flat rate',
'status' => '1',
'price' => '10',
'type' => [
'per_unit' => 'Per Unit',
'per order' => 'Per Order',
],
'class' => 'Webkul\Shipping\Helper\Rate',
],
[
'code' => 'flatrate_two',
'title' => 'Flatrate Two',
'name' => 'fixed 50% discount till 10/10/2018',
'description' => 'this is a flat rate',
'status' => '1',
'price' => '100',
'type' => [
'per unit' => 'Per Unit',
'per order' => 'Per Order',
],
'class' => 'Webkul\Shipping\Helper\Rate',
],
[
'code' => 'flatrate_three',
'title' => 'Flatrate Three',
'name' => 'fixed 30% discount',
'description' => 'this is a flat rate',
'status' => '1',
'price' => '1000',
'type' => [
'per unit' => 'Per Unit',
'per order' => 'Per Order',
],
'class' => 'Webkul\Shipping\Helper\Rate',
]
]
]
?>

View File

@ -71,21 +71,21 @@ class ChannelDataGrid
[
'name' => 'id',
'alias' => 'channel_id',
'alias' => 'channelID',
'type' => 'number',
'label' => 'Channel ID',
'sortable' => true,
],
[
'name' => 'code',
'alias' => 'channel_code',
'alias' => 'channelCode',
'type' => 'string',
'label' => 'Channel Code',
'sortable' => true,
],
[
'name' => 'name',
'alias' => 'channel_name',
'alias' => 'channelName',
'type' => 'string',
'label' => 'Channel Name',
'sortable' => true,
@ -98,7 +98,7 @@ class ChannelDataGrid
'filterable' => [
[
'column' => 'id',
'alias' => 'channelId',
'alias' => 'channelID',
'type' => 'number',
'label' => 'Channel ID',
],

View File

@ -0,0 +1,184 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* Customer DataGrid
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com> @rahul-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerDataGrid
{
/**
* The CustomerDataGrid
* implementation.
*
* @var CustomerDataGrid
*/
public function createCustomerDataGrid()
{
return DataGrid::make([
'name' => 'Customer',
'table' => 'customers',
'select' => 'id',
'perpage' => 10,
'aliased' => false, //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' => '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',
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
'name' => 'first_name',
'alias' => 'customerFirstName',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
],
[
'name' => 'email',
'alias' => 'customerEmail',
'type' => 'string',
'label' => 'Email',
'sortable' => true,
],
[
'name' => 'phone',
'alias' => 'customerPhone',
'type' => 'number',
'label' => 'Phone',
'sortable' => true,
],
[
'name' => 'customer_group_id',
'alias' => 'customerGroupId',
'type' => 'number',
'label' => 'Customer Group',
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
'name' => 'id',
'alias' => 'customerId',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'first_name',
'alias' => 'customerFirstName',
'type' => 'string',
'label' => 'Name',
],
[
'name' => 'phone',
'alias' => 'customerPhone',
'type' => 'number',
'label' => 'Phone',
],
[
'name' => 'email',
'alias' => 'customerEmail',
'type' => 'string',
'label' => 'Comment',
],
[
'name' => 'customer_group_id',
'alias' => 'customerGroupId',
'type' => 'number',
'label' => 'Status',
],
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'first_name',
'type' => 'string',
'label' => 'Title',
],
[
'column' => 'email',
'type' => 'string',
'label' => 'Rating',
],
],
//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->createCustomerDataGrid()->render();
}
}

View File

@ -0,0 +1,183 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* Review DataGrid
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com> @rahul-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerReviewDataGrid
{
/**
* The CustomerReviewDataGrid
* implementation.
*
* @var ReviewsDataGrid
* for Reviews
*/
public function createCustomerReviewDataGrid()
{
return DataGrid::make([
'name' => 'Review',
'table' => 'product_reviews',
'select' => 'id',
'perpage' => 10,
'aliased' => false, //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' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'id',
'alias' => 'reviewId',
'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' => 'countryStatus',
'type' => 'number',
'label' => 'Status',
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
'name' => 'id',
'alias' => 'countryId',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'title',
'alias' => 'titleName',
'type' => 'string',
'label' => 'Title',
],
[
'name' => 'rating',
'alias' => 'productRating',
'type' => 'number',
'label' => 'Rating',
],
[
'name' => 'comment',
'alias' => 'productComment',
'type' => 'string',
'label' => 'Comment',
],
[
'name' => 'status',
'alias' => 'countryStatus',
'type' => 'number',
'label' => 'Code',
],
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'title',
'type' => 'string',
'label' => 'Title',
],
[
'column' => 'rating',
'type' => 'number',
'label' => 'Rating',
],
],
//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->createCustomerReviewDataGrid()->render();
}
}

View File

@ -42,7 +42,7 @@ class InventorySourcesDataGrid
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'route' => route('admin.datagrid.edit'),
'confirm_text' => 'Do you really edit this record?',
'icon' => 'icon pencil-lg-icon',
], [
@ -110,7 +110,7 @@ class InventorySourcesDataGrid
'filterable' => [
[
'column' => 'id',
'alias' => 'inventoryId',
'alias' => 'inventoryID',
'type' => 'number',
'label' => 'ID',
],

View File

@ -6,7 +6,6 @@ use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\ProductGrid;
use Webkul\Channel\Repositories\ChannelRepository;
use Webkul\Product\Repositories\ProductRepository;
/**
* Product DataGrid
*
@ -24,7 +23,6 @@ class ProductDataGrid
public function createProductDataGrid()
{
return ProductGrid::make([
'name' => 'Products',
'table' => 'products as prods',
@ -77,10 +75,15 @@ class ProductDataGrid
'primaryKey' => 'prods.id',
'condition' => '=',
'secondaryKey' => 'pav.product_id',
'withAttributes' => true
'withAttributes' => [
'condition' => [
'attribute_id' => 2,
'select' => 'name',
]
]
],
//for getting the inventory quantity of a product
// for getting the inventory quantity of a product
[
'join' => 'leftjoin',
'table' => 'product_inventories as pi',
@ -120,17 +123,9 @@ class ProductDataGrid
'name' => 'pi.qty',
'alias' => 'ProductQuantity',
'type' => 'string',
'label' => 'Product Quatity',
'label' => 'Product Quantity',
'sortable' => false,
],
// [
// 'name' => 'pav.attribute_id',
// 'alias' => 'AttributeID',
// 'type' => 'string',
// 'label' => 'Attribute ID',
// 'sortable' => false,
// ],
],
'filterable' => [
@ -156,7 +151,7 @@ class ProductDataGrid
[
'name' => 'pi.qty',
'alias' => 'ProductQuantity',
'type' => 'string',
'type' => 'number',
'label' => 'Product Quatity',
],
],

View File

@ -100,24 +100,24 @@ class SliderDataGrid
//don't use aliasing in case of filters
'filterable' => [
// [
// 'column' => 'id',
// 'alias' => 'locale_id',
// 'type' => 'number',
// 'label' => 'ID',
// ],
// [
// 'column' => 'code',
// 'alias' => 'locale_code',
// 'type' => 'string',
// 'label' => 'Code',
// ],
// [
// 'column' => 'name',
// 'alias' => 'locale_name',
// 'type' => 'string',
// 'label' => 'Name',
// ],
[
'column' => 'id',
'alias' => 'locale_id',
'type' => 'number',
'label' => 'ID',
],
[
'column' => 'code',
'alias' => 'locale_code',
'type' => 'string',
'label' => 'Code',
],
[
'column' => 'name',
'alias' => 'locale_name',
'type' => 'string',
'label' => 'Name',
],
],
//don't use aliasing in case of searchables

View File

@ -0,0 +1,199 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* Tax Rates DataGrid
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxRateDataGrid
{
/**
* The Tax Rule Data
* Grid implementation.
*
* @var TaxRateDataGrid
*/
public function createTaxRateDataGrid()
{
return DataGrid::make([
'name' => 'Tax Rates',
'table' => 'tax_rates as tr',
'select' => 'tr.id',
'perpage' => 10,
'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',
],
[
'route' => route('admin.datagrid.index'),
'method' => 'POST',
'label' => 'View Grid',
'type' => 'select',
'options' =>[
1 => 'Edit',
2 => 'Set',
3 => 'Change Status'
]
],
],
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really wanis?',
'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' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'tr.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
'name' => 'tr.identifier',
'alias' => 'identifier',
'type' => 'string',
'label' => 'Identifier',
'sortable' => true,
// 'wrapper' => function ($value, $object) {
// return '<a class="color-red">' . $object->Name . '</a>';
// },
],
[
'name' => 'tr.state',
'alias' => 'state',
'type' => 'string',
'label' => 'State',
'sortable' => true,
],
[
'name' => 'tr.country',
'alias' => 'country',
'type' => 'string',
'label' => 'Country',
'sortable' => true,
],
[
'name' => 'tr.tax_rate',
'alias' => 'tax_rate',
'type' => 'number',
'label' => 'Tax Rate',
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
'name' => 'tr.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
],
[
'name' => 'tr.identifier',
'alias' => 'identifier',
'type' => 'string',
'label' => 'Identifier',
],
[
'name' => 'tr.state',
'alias' => 'state',
'type' => 'string',
'label' => 'State',
],
[
'name' => 'tr.country',
'alias' => 'country',
'type' => 'string',
'label' => 'Country',
],
[
'name' => 'tr.tax_rate',
'alias' => 'tax_rate',
'type' => 'number',
'label' => 'Tax Rate',
],
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'tr.identifier',
'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' => "=",
'lt' => "<",
'gt' => ">",
'lte' => "<=",
'gte' => ">=",
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
]);
}
public function render() {
return $this->createTaxRateDataGrid()->render();
}
}

View File

@ -0,0 +1,160 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
/**
* Tax Rules DataGrid
*
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxRuleDataGrid
{
/**
* The Tax Rule Data
* Grid implementation.
*
* @var TaxRuleDataGrid
*/
public function createTaxRuleDataGrid()
{
return DataGrid::make([
'name' => 'Tax Rule',
'table' => 'tax_categories as tr',
'select' => 'tr.id',
'perpage' => 10,
'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',
],
[
'route' => route('admin.datagrid.index'),
'method' => 'POST',
'label' => 'View Grid',
'type' => 'select',
'options' =>[
1 => 'Edit',
2 => 'Set',
3 => 'Change Status'
]
],
],
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really wanis?',
'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' => 'roles as r',
// 'primaryKey' => 'u.role_id',
// 'condition' => '=',
// 'secondaryKey' => 'r.id',
// ]
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'tr.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID',
'sortable' => true,
],
[
'name' => 'tr.name',
'alias' => 'Name',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
// 'wrapper' => function ($value, $object) {
// return '<a class="color-red">' . $object->Name . '</a>';
// },
],
[
'name' => 'tr.code',
'alias' => 'code',
'type' => 'string',
'label' => 'Code',
'sortable' => true,
],
],
//don't use aliasing in case of filters
'filterable' => [
[
'column' => 'tr.name',
'alias' => 'Name',
'type' => 'number',
'label' => 'Name'
],
[
'column' => 'tr.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'ID'
],
[
'column' => 'tr.code',
'alias' => 'code',
'type' => 'string',
'label' => 'Code'
]
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'tr.code',
'type' => 'string',
'label' => 'Code'
],
[
'column' => 'tr.name',
'type' => 'string',
'label' => 'Name'
]
],
'operators' => [
'eq' => "=",
'lt' => "<",
'gt' => ">",
'lte' => "<=",
'gte' => ">=",
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
'nlike' => "not like",
],
// 'css' => []
]);
}
public function render() {
return $this->createTaxRuleDataGrid()->render();
}
}

View File

@ -25,6 +25,7 @@ class UserDataGrid
{
return DataGrid::make([
'name' => 'Admins',
'table' => 'admins as u',
'select' => 'u.id',
@ -38,23 +39,23 @@ class UserDataGrid
'label' => 'Delete',
'type' => 'button',
],
// [
// 'route' => route('admin.datagrid.index'),
// 'method' => 'POST',
// 'label' => 'View Grid',
// 'type' => 'select',
// 'options' =>[
// 1 => 'Edit',
// 2 => 'Set',
// 3 => 'Change Status'
// ]
// ],
[
'route' => route('admin.datagrid.index'),
'method' => 'POST',
'label' => 'View Grid',
'type' => 'select',
'options' =>[
1 => 'Edit',
2 => 'Set',
3 => 'Change Status'
]
],
],
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really want to do this?',
'confirm_text' => 'Do you really wanis?',
'icon' => 'icon pencil-lg-icon',
],
[
@ -83,8 +84,8 @@ class UserDataGrid
'label' => 'Admin ID',
'sortable' => true,
'wrapper' => function ($value, $object) {
return '<a class="color-red">' . $object->ID . '</a>';
},
return '<a class="color-red">' . $object->ID . '</a>';
},
],
[
'name' => 'u.name',
@ -93,8 +94,8 @@ class UserDataGrid
'label' => 'Name',
'sortable' => true,
'wrapper' => function ($value, $object) {
return '<a class="color-red">' . $object->Name . '</a>';
},
return '<a class="color-red">' . $object->Name . '</a>';
},
],
[
'name' => 'u.email',
@ -117,27 +118,6 @@ class UserDataGrid
'label' => 'Role ID',
'sortable' => true,
],
// [
// 'name' => 'a.first_name',
// 'type' => 'string',
// 'label' => 'Admin Name',
// 'sortable' => true,
// 'filterable' => true,
// // will create on run time query
// // 'filter' => [
// // 'function' => 'where', // orwhere
// // 'condition' => ['name', '=', 'Admin'] // multiarray
// // ],
// 'attributes' => [
// 'class' => 'class-a class-b',
// 'data-attr' => 'whatever you want',
// 'onclick' => "window.alert('alert from datagrid column')"
// ],
// 'wrapper' => function ($value, $object) {
// return '<a href="'.$value.'">' . $object->first_name . '</a>';
// },
// ],
],
//don't use aliasing in case of filters
'filterable' => [

View File

@ -1,151 +0,0 @@
<?php
namespace Webkul\Admin\Datagrids;
use Illuminate\View\View;
use Webkul\Ui\DataGrid\Facades\DataGrid;
class User
{
/**
* Create datagrid.
*
* @return void
*/
public function createDatagrid()
{
return DataGrid::make([
'name' => 'Admins',
'table' => 'admins as u',
'select' => 'u.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' => 'roles as r',
'primaryKey' => 'u.role_id',
'condition' => '=',
'secondaryKey' => 'r.id',
]
],
//use aliasing on secodary columns if join is performed
'columns' => [
[
'name' => 'u.id',
'alias' => 'ID',
'type' => 'string',
'label' => 'Admin ID',
'sortable' => true,
'wrapper' => function ($value, $object) {
return '<a class="color-red">' . $object->ID . '</a>';
},
], [
'name' => 'u.name',
'alias' => 'Name',
'type' => 'string',
'label' => 'Name',
'sortable' => true,
'wrapper' => function ($value, $object) {
return '<a class="color-red">' . $object->Name . '</a>';
},
], [
'name' => 'u.email',
'alias' => 'Email',
'type' => 'string',
'label' => 'E-Mail',
'sortable' => true,
], [
'name' => 'r.name',
'alias' => 'xa',
'type' => 'string',
'label' => 'Role Name',
'sortable' => true,
], [
'name' => 'r.id',
'alias' => 'xc',
'type' => 'string',
'label' => 'Role ID',
'sortable' => true,
]
],
//don't use aliasing in case of filters
'filterable' => [
[
'column' => 'u.name',
'alias' => 'Name',
'type' => 'string',
'label' => 'Name'
], [
'column' => 'u.email',
'alias' => 'Email',
'type' => 'string',
'label' => 'Email'
], [
'column' => 'u.id',
'alias' => 'ID',
'type' => 'number',
'label' => 'Admin ID'
], [
'column' => 'r.id',
'alias' => 'Role_ID',
'type' => 'number',
'label' => 'Role ID'
]
],
//don't use aliasing in case of searchables
'searchable' => [
[
'column' => 'u.email',
'type' => 'string',
'label' => 'E-Mail'
], [
'column' => 'u.name',
'type' => 'string',
'label' => 'Name'
]
],
'operators' => [
'eq' => "=",
'lt' => "<",
'gt' => ">",
'lte' => "<=",
'gte' => ">=",
'neqs' => "<>",
'neqn' => "!=",
'like' => "like",
'nlike' => "not like",
],
]);
}
public function render()
{
return $this->createDatagrid()->render();
}
}

View File

@ -24,6 +24,8 @@ class DashboardController extends Controller
public function __construct()
{
$this->_config = request('_config');
$this->middleware('admin');
}
public function index()
{

View File

@ -15,6 +15,7 @@ use Webkul\Ui\DataGrid\Facades\DataGrid;
*/
class DataGridController extends Controller
{
/**
* Display a listing of the resource.
*

View File

@ -9,7 +9,7 @@ Route::group(['middleware' => ['web']], function () {
Route::post('/login', 'Webkul\User\Http\Controllers\SessionController@store')->defaults('_config', [
'redirect' => 'admin.dashboard.index'
])->name('admin.forget-password.store');
])->name('admin.session.store');
// Forget Password Routes
@ -36,10 +36,52 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'admin.session.create'
])->name('admin.session.destroy');
// Dashboard Route
Route::get('/dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index');
Route::get('dashboard', 'Webkul\Admin\Http\Controllers\DashboardController@index')->name('admin.dashboard.index');
//Customers Management Routes
Route::get('customer', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config', [
'view' => 'admin::customers.index'
])->name('admin.customer.index');
Route::get('customer/orders', 'Webkul\Core\Http\Controllers\CustomerController@index')->defaults('_config',[
'view' => 'admin::customers.orders.index'
])->name('admin.customer.orders.index');
Route::get('customer/reviews', 'Webkul\Shop\Http\Controllers\ReviewController@index')->defaults('_config',[
'view' => 'admin::customers.review.index'
])->name('admin.customer.review.index');
Route::get('customer/create', 'Webkul\Core\Http\Controllers\CustomerController@create')->defaults('_config',[
'view' => 'admin::customers.create'
])->name('admin.customer.create');
Route::post('customer/create', 'Webkul\Core\Http\Controllers\CustomerController@store')->defaults('_config',[
'redirect' => 'admin.customer.index'
])->name('admin.customer.store');
Route::get('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@edit')->defaults('_config',[
'view' => 'admin::customers.review.edit'
])->name('admin.customer.review.edit');
Route::put('customer/reviews/edit/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@update')->defaults('_config', [
'redirect' => 'admin.customer.review.index'
])->name('admin.customer.review.update');
Route::get('customer/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@edit')->defaults('_config',[
'view' => 'admin::customers.edit'
])->name('admin.customer.edit');
Route::put('customer/reviews/edit/{id}', 'Webkul\Core\Http\Controllers\CustomerController@update')->defaults('_config', [
'redirect' => 'admin.customer.index'
])->name('admin.customer.update');
// dummy number i.e-1 is used for creating view only
Route::get('customer/orders/1', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
'view' => 'admin::customers.orders.order'
])->name('admin.customer.orders.order');
// Catalog Routes
Route::prefix('catalog')->group(function () {
@ -140,6 +182,8 @@ Route::group(['middleware' => ['web']], function () {
Route::any('datagrid/massaction/delete', 'Webkul\Admin\Http\Controllers\DataGridController@massDelete')->name('admin.datagrid.delete');
Route::any('datagrid/massaction/edit','Webkul\Admin\Http\Controllers\DataGridController@massUpdate')->name('admin.datagrid.edit');
// User Routes
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
'view' => 'admin::users.users.index'
@ -313,6 +357,56 @@ Route::group(['middleware' => ['web']], function () {
Route::post('/slider/create','Webkul\Shop\Http\Controllers\SliderController@store')->defaults('_config',[
'redirect' => 'admin::sliders.index'
])->name('admin.sliders.store');
//tax routes
Route::prefix('tax')->group(function () {
Route::get('taxrule', 'Webkul\Core\Http\Controllers\TaxController@index')->defaults('_config', [
'view' => 'admin::tax.taxrule.index'
])->name('admin.taxrule.index');
// tax rule routes
Route::get('taxrule/create', 'Webkul\Core\Http\Controllers\TaxCategoryController@show')->defaults('_config', [
'view' => 'admin::tax.taxrule.create.create'
])->name('admin.taxrule.show');
Route::post('taxrule/create', 'Webkul\Core\Http\Controllers\TaxCategoryController@create')->defaults('_config', [
'redirect' => 'admin.taxrule.index'
])->name('admin.taxrule.create');
Route::get('/taxrule/edit/{id}', 'Webkul\Core\Http\Controllers\TaxCategoryController@edit')->defaults('_config', [
'view' => 'admin::tax.taxrule.edit.edit'
])->name('admin.taxrule.edit');
Route::put('/taxrule/edit/{id}', 'Webkul\Core\Http\Controllers\TaxCategoryController@update')->defaults('_config', [
'redirect' => 'admin.taxrule.index'
])->name('admin.taxrule.update');
//tax rule ends
//tax rate
Route::get('taxrate', 'Webkul\Core\Http\Controllers\TaxRateController@index')->defaults('_config', [
'view' => 'admin::tax.taxrate.index'
])->name('admin.taxrate.index');
Route::get('taxrate/create', 'Webkul\Core\Http\Controllers\TaxRateController@show')->defaults('_config', [
'view' => 'admin::tax.taxrate.create.taxrate'
])->name('admin.taxrate.show');
Route::post('taxrate/create', 'Webkul\Core\Http\Controllers\TaxRateController@create')->defaults('_config', [
'redirect' => 'admin.taxrate.index'
])->name('admin.taxrate.create');
Route::get('taxrate/edit/{id}', 'Webkul\Core\Http\Controllers\TaxRateController@edit')->defaults('_config', [
'view' => 'admin::tax.taxrate.edit.edit'
])->name('admin.taxrate.store');
Route::put('taxrate/update/{id}', 'Webkul\Core\Http\Controllers\TaxRateController@update')->defaults('_config', [
'redirect' => 'admin.taxrate.index'
])->name('admin.taxrate.update');
});
//tax rate ends
});
});
});

View File

@ -52,6 +52,18 @@ class EventServiceProvider extends ServiceProvider
$menu->add('catalog.families', 'Families', 'admin.catalog.families.index', 4);
$menu->add('customers', 'Customers', 'admin.customer.index', 5, 'customer-icon');
$menu->add('customers.customers', 'Customers', 'admin.customer.index', 1, '');
$menu->add('customers.orders', 'Orders', 'admin.customer.orders.index', 2, '');
$menu->add('customers.reviews', 'Review', 'admin.customer.review.index', 3, '');
// $menu->add('customers.blocked_customer', 'Blocked Customers', 'admin.account.edit', 2, '');
// $menu->add('customers.allowed_customer', 'Allowed Customers', 'admin.account.edit', 4, '');
$menu->add('configuration', 'Configure', 'admin.account.edit', 6, 'configuration-icon');
$menu->add('configuration.account', 'My Account', 'admin.account.edit', 1);
@ -77,6 +89,12 @@ class EventServiceProvider extends ServiceProvider
$menu->add('settings.users.roles', 'Roles', 'admin.roles.index', 2, '');
$menu->add('settings.sliders', 'Create Sliders', 'admin.sliders.index', 8, '');
$menu->add('settings.tax', 'Taxes', 'admin.taxrule.index', 9, '');
$menu->add('settings.tax.taxrule', 'Add Tax Rules', 'admin.taxrule.index', 1, '');
$menu->add('settings.tax.taxrate', 'Add Tax Rates', 'admin.taxrate.index', 2, '');
});
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Angle-Right</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Angle-Right" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<polyline id="Path-3" stroke="#A2A2A2" stroke-width="3" points="7 3 14 10.058476 7.11598308 17"></polyline>
</g>
</svg>

After

Width:  |  Height:  |  Size: 618 B

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>Icon-Graph-Green</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Icon-Graph-Green" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g transform="translate(8.000000, 5.000000)" stroke="#00C357" stroke-width="2">
<path d="M4,0 L4,14" id="Path-2"></path>
<path d="M4,0 L0,4" id="Path-3"></path>
<path d="M7.92330631,0 L3.92330631,4" id="Path-3-Copy" transform="translate(5.961653, 2.000000) scale(-1, 1) translate(-5.961653, -2.000000) "></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 881 B

View File

@ -249,3 +249,53 @@ body {
// }
// }
// }
// admin dashboard css
.dashboard-content {
.dashboard-stats {
display: flex;
}
.graph-category {
display: flex;
margin-top: 25px;
}
.sale-stock {
display: flex;
margin-top: 25px;
}
}
// admin dashboard css ends here
// customer oder css for admin start here
.order-place-detail {
.order-account-information {
margin-left: 10px;
}
.address {
margin-left: 10px;
}
.payment-shipping{
margin-left: 10px;
}
.order-products{
margin-left: 10px;
}
}
// customer oder css for admin end here

View File

@ -41,7 +41,7 @@ return [
'all' => 'All'
],
'users' => [
'title' => 'Users',
'title' => 'User',
'add-user-title' => 'Add User',
'edit-user-title' => 'Edit User',
'save-btn-title' => 'Save User',
@ -175,6 +175,43 @@ return [
'meta_keywords' => 'Meta Keywords',
]
],
'configuration' => [
'tax' => [
'title' => 'Taxes',
'add-title' => 'Add Tax Rule'
],
'taxrule' => [
'title' => 'Add Tax Rule',
'create' => 'Create Tax Rule',
'general' => 'Tax Rule',
'select-channel' => 'Select Channel',
'name' => 'Name',
'code' => 'Code',
'description' => 'Description',
'select-taxrates' => 'Select Tax Rates',
'edit' => [
'title' => 'Edit Tax Rule',
'edit-button-title' => 'Edit Rule'
]
],
'taxrate' => [
'title' => 'Add Tax Rate',
'general' => 'Tax Rate',
'identifier' => 'Identifier',
'is_zip' => 'Enable Zip Range',
'zip_from' => 'Zip From',
'zip_to' => 'Zip To',
'state' => 'State',
'country' => 'Country',
'tax_rate' => 'Rate',
'edit' => [
'title' => 'Edit Tax Rate',
'edit-button-title' => 'Edit Rate'
]
],
],
'settings' => [
'locales' => [
'title' => 'Locales',
@ -265,5 +302,24 @@ return [
'content' => 'Content',
'channels' => 'Channel'
],
],
'customers' => [
'customers' => [
'title' => 'Customers',
'first_name' => 'First Name',
'last_name' => 'Last Name',
'gender' => 'Gender',
'email' => 'Email',
'date_of_birth' => 'Date of Birth',
'phone' => 'Phone',
'customer_group' => 'Customer Group'
],
'reviews' => [
'title' => 'Title',
'name' => 'Reviews',
'rating' => 'Rating',
'status' => 'Status',
'comment' => 'Comment'
]
]
];

View File

@ -18,7 +18,7 @@
</div>
<div class="page-content">
<div class="form-container">
@csrf()

View File

@ -73,9 +73,9 @@
<div class="hide">
<accordian :title="'{{ __('admin::app.catalog.attributes.options') }}'" :active="true" :id="'options'">
<div slot="body">
<option-wrapper></option-wrapper>
</div>
</accordian>
</div>
@ -122,7 +122,7 @@
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
</select>
</div>
<div class="control-group">
<label for="value_per_locale">{{ __('admin::app.catalog.attributes.value_per_locale') }}</label>
<select class="control" id="value_per_locale" name="value_per_locale">
@ -130,7 +130,7 @@
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
</select>
</div>
<div class="control-group">
<label for="value_per_channel">{{ __('admin::app.catalog.attributes.value_per_channel') }}</label>
<select class="control" id="value_per_channel" name="value_per_channel">
@ -138,7 +138,7 @@
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
</select>
</div>
<div class="control-group">
<label for="is_filterable">{{ __('admin::app.catalog.attributes.is_filterable') }}</label>
<select class="control" id="is_filterable" name="is_filterable">
@ -146,7 +146,7 @@
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
</select>
</div>
<div class="control-group">
<label for="is_configurable">{{ __('admin::app.catalog.attributes.is_configurable') }}</label>
<select class="control" id="is_configurable" name="is_configurable">
@ -154,7 +154,7 @@
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
</select>
</div>
<div class="control-group">
<label for="is_visible_on_front">{{ __('admin::app.catalog.attributes.is_visible_on_front') }}</label>
<select class="control" id="is_visible_on_front" name="is_visible_on_front">
@ -184,7 +184,7 @@
@foreach(Webkul\Core\Models\Locale::all() as $locale)
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
@endforeach
<th>{{ __('admin::app.catalog.attributes.position') }}</th>
@ -192,7 +192,7 @@
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="row in optionRows">
<td>
@ -244,7 +244,7 @@
var optionWrapper = Vue.component('option-wrapper', {
template: '#options-template',
template: '#options-template',
data: () => ({
optionRowCount: 0,

View File

@ -19,7 +19,7 @@
<div class="control-group">
<select class="control" id="channel-switcher" name="channel">
@foreach(core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@ -31,7 +31,7 @@
<div class="control-group">
<select class="control" id="locale-switcher" name="locale">
@foreach(core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@ -61,8 +61,8 @@
@foreach($attributeGroup->custom_attributes as $attribute)
@if(!$product->super_attributes->contains($attribute))
<?php
<?php
$validations = [];
$disabled = false;
if($product->type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight'])) {
@ -79,7 +79,7 @@
}
$validations = implode('|', array_filter($validations));
?>
?>
@if(view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
@ -97,7 +97,7 @@
array_push($channel_locale, $locale);
}
?>
@if(count($channel_locale))
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
@endif
@ -111,7 +111,7 @@
@endif
@endif
@endforeach
</div>
@ -120,11 +120,11 @@
@endforeach
@if ($form_accordians)
@foreach ($form_accordians->items as $accordian)
@include ($accordian['view'])
@endforeach
@endif

View File

@ -0,0 +1,83 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.customer.store') }}">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.customers.customers.title') }}
{{ Config::get('carrier.social.facebook.url') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.account.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.account.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name">{{ __('shop::app.customer.signup-form.firstname') }}</label>
<input type="text" class="control" name="first_name" v-validate="'required'" value="{{ old('first_name') }}">
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name">{{ __('shop::app.customer.signup-form.lastname') }}</label>
<input type="text" class="control" name="last_name" v-validate="'required'" value="{{ old('last_name') }}">
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email">{{ __('shop::app.customer.signup-form.email') }}</label>
<input type="email" class="control" name="email" v-validate="'required|email'" value="{{ old('email') }}">
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
<div class="control-group">
<label for="gender">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" v-validate="'required'">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
<div class="control-group">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" v-validate="'required'">
</div>
<div class="control-group">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" v-validate="'required'">
</div>
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.customers.customer_group') }}</label>
<select class="control" name="customer_group_id">
@foreach ($customerGroup as $group)
<option value="{{ $group->id }}"> {{ $group->group_name}} </>
@endforeach
</select>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,84 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.customer.update', $customer->id) }}">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.customers.customers.title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.account.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<input name="_method" type="hidden" value="PUT">
<accordian :title="'{{ __('admin::app.account.general') }}'" :active="true">
<div slot="body">
<div class="control-group">
<label for="name" > {{ __('admin::app.customers.customers.first_name') }}</label>
<input type="text" class="control" name="first_name" value="{{$customer->first_name}}"/>
</div>
<div class="control-group">
<label for="name" > {{ __('admin::app.customers.customers.last_name') }}</label>
<input type="text" class="control" name="last_name" value="{{$customer->last_name}}"/>
</div>
<div class="control-group">
<label for="name" > {{ __('admin::app.customers.customers.email') }}</label>
<input type="text" class="control" name="email" value="{{$customer->email}}"/>
</div>
<div class="control-group">
<label for="email">{{ __('admin::app.customers.customers.gender') }}</label>
<select name="gender" class="control" value="{{ $customer->gender }}" v-validate="'required'">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
<div class="control-group">
<label for="dob">{{ __('admin::app.customers.customers.date_of_birth') }}</label>
<input type="date" class="control" name="date_of_birth" value="{{ $customer->date_of_birth }}" v-validate="'required'">
</div>
<div class="control-group">
<label for="phone">{{ __('admin::app.customers.customers.phone') }}</label>
<input type="text" class="control" name="phone" value="{{ $customer->phone }}" v-validate="'required'">
</div>
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.customers.customer_group') }}</label>
<?php $selectedOption = $customer->customerGroup->id ?>
<select class="control" name="customer_group_id">
@foreach($customerGroup as $group)
<option value="{{ $group->id }}" {{ $selectedOption == $group->id ? 'selected' : '' }}>
{{ $group->group_name}}
</option>
@endforeach
</select>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,28 @@
@extends('admin::layouts.content')
@section('page_title')
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.customers.customers.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.customer.create') }}" class="btn btn-lg btn-primary">
{{ __('Add Customer') }}
</a>
</div>
</div>
<div class="page-content">
@inject('customer','Webkul\Admin\DataGrids\CustomerDataGrid')
{!! $customer->render() !!}
</div>
</div>
@stop

View File

@ -0,0 +1,25 @@
@extends('admin::layouts.content')
@section('page_title')
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>Customers</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.users.create') }}" class="btn btn-lg btn-primary">
{{ __('Add Customer') }}
</a>
</div>
</div>
<div class="page-content">
</div>
</div>
@stop

View File

@ -0,0 +1,353 @@
@extends('admin::layouts.master')
@section('content-wrapper')
<div class="order-place-detail">
<div class="order-account-information">
<accordian :title="'Order and Account'" :active="true">
<div slot="body">
<div class="order-information">
<div class="order-info">
<span>Order Information <span >
<span class="edit">
Edit
</span>
</div>
<div class="horizotal-rule"> </div>
<div class="order-account">
<div class="left-content">
<span>
Order Date
</span>
</div>
<div class="right-content">
<span>
August 4,2018,9:05:36:AM
</span>
</div>
</div>
<div class="order-account">
<div class="left-content">
<span>
Order Status
</span>
</div>
<div class="right-content">
<span>
Pending
</span>
</div>
</div>
<div class="order-account">
<div class="left-content">
<span>
Channel
</span>
</div>
<div class="right-content">
<span>
Web Store-en_GB
</span>
</div>
</div>
</div>
<div class="account-information">
<div class="account-info">
<span>Account Information <span >
<span class="edit">
Edit
</span>
</div>
<div class="horizotal-rule"> </div>
<div class="order-account">
<div class="left-content">
<span >
Customer Name
</span>
</div>
<div class="right-content">
<span class="name">
Lee Stoike
</span>
</div>
</div>
<div class="order-account">
<div class="left-content">
<span>
Email
</span>
</div>
<div class="right-content">
<span>
lee.stoike@examplemail.com
</span>
</div>
</div>
<div class="order-account">
<div class="left-content">
<span>
Contact Number
</span>
</div>
<div class="right-content">
<span>
9876543210
</span>
</div>
</div>
</div>
</div>
</accordian>
</div>
<div class="address">
<accordian :title="'Address'" :active="true">
<div slot="body">
<div class="address-information">
<div class="address-name">
<span> Shipping Address <span >
<span class="edit">
Edit
</span>
</div>
<div class="horizotal-rule"> </div>
<div class="address-detail">
<span> 0933 Crossing Suite 12B </span>
<span> Dallas , Texas <span>
<span> United States </span>
<span> 75001 </span>
</div>
</div>
<div class="address-information">
<div class="address-name">
<span> Billing Address <span >
<span class="edit">
Edit
</span>
</div>
<div class="horizotal-rule"> </div>
<div class="address-detail">
<span> 0933 Crossing Suite 12B </span>
<span> Dallas , Texas <span>
<span> United States </span>
<span> 75001 </span>
</div>
</div>
</div>
</accordian>
</div>
<div class="payment-shipping">
<accordian :title="'Payment and Shipping'" :active="true">
<div slot="body">
<div class="payment-information">
<div class="title">
<span>Payment Information <span >
</div>
<div class="horizotal-rule"> </div>
<div class="payment-info">
<div class="left-content">
<span>
Payment Method
</span>
</div>
<div class="right-content">
<span>
Bank Wire Transfer
</span>
</div>
</div>
<div class="payment-info">
<div class="left-content">
<span>
Currency
</span>
</div>
<div class="right-content">
<span>
US Dollar
</span>
</div>
</div>
</div>
<div class="payment-information">
<div class="title">
<span> Shipping Information <span >
</div>
<div class="horizotal-rule"> </div>
<div class="payment-info">
<div class="left-content">
<span>
Shipping Method
</span>
</div>
<div class="right-content">
<span>
Flat Rate-Fixed-$10.00
</span>
</div>
</div>
<div class="payment-info">
<div class="left-content">
<span>
Expected Delivery
</span>
</div>
<div class="right-content">
<span>
3 Days
</span>
</div>
</div>
</div>
</div>
</accordian>
</div>
<div class="order-products">
<accordian :title="'Products Ordered'" :active="true">
<div slot="body">
<div class="table">
<table>
<thead>
<tr>
<th>SKU</th>
<th>Product Name</th>
<th>Item Status</th>
<th>Price</th>
<th>Qty</th>
<th>Row total</th>
</tr>
</thead>
<tbody>
<tr>
<td>PROD124</td>
<td>Apple iPhone 7- White-32GB</td>
<td>Packed (2)</td>
<td>$350.00</td>
<td>2</td>
<td>$700.00</td>
</tr>
<tr>
<td>PROD128</td>
<td>Blue Linen T-Shirt for Men- Small- Red</td>
<td>Shipped (2)</td>
<td>$45.00</td>
<td>2</td>
<td>$35.00</td>
</tr>
</tbody>
</table>
</div>
<div class="total">
<div class="calculate">
<div class="sub-total">
<span class="left">
Subtotal
</span>
<span class="middle">
-
</span>
<span class="right">
$805.00
</span>
</div>
<div class="ship-handle">
<span class="left">
Shipping & handling
</span>
<span class="middle">
-
</span>
<span class="right">
$5.00
</span>
</div>
<div class="discount">
<span class="left">
Discounts
</span>
<span class="middle">
-
</span>
<span class="right">
$15.00
</span>
</div>
<div class="grand-total">
<span class="left">
Grand Total
</span>
<span class="middle">
-
</span>
<span class="right">
$15.00
</span>
</div>
<div class="due">
<span class="left">
Total Due
</span>
<span class="middle">
-
</span>
<span class="right">
$15.00
</span>
</div>
</div>
</div>
</div>
</accordian>
</div>
<div>
@stop

View File

@ -0,0 +1,69 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.customer.review.update', $review->id) }}">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.customers.reviews.name') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.account.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<input name="_method" type="hidden" value="PUT">
<accordian :title="'{{ __('admin::app.account.general') }}'" :active="true">
<div slot="body">
<div class="control-group">
<label for="name" > {{ __('admin::app.customers.reviews.title') }}</label>
<input type="text" class="control" id="name" name="name" value="{{$review->title}}" disabled/>
</div>
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.reviews.rating') }}</label>
@for($i = 1; $i <= $review->rating ; $i++)
<span class="stars">
<span class="icon star-icon"></span>
</span>
@endfor
</div>
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.reviews.status') }}</label>
<select class="control" name="status">
<option value="1">
1
</option>
<option value="2">
2
</option>
</select>
</div>
<div class="control-group">
<label for="name" >{{ __('admin::app.customers.reviews.comment') }}</label>
<textarea class="control" disabled> {{$review->comment}}</textarea>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,27 @@
@extends('admin::layouts.content')
@section('page_title')
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.customers.reviews.name') }}</h1>
</div>
<div class="page-action">
{{-- <a href="{{ route('admin.users.create') }}" class="btn btn-lg btn-primary">
{{ __('Add Customer') }}
</a> --}}
</div>
</div>
<div class="page-content">
@inject('review','Webkul\Admin\DataGrids\CustomerReviewDataGrid')
{!! $review->render() !!}
</div>
</div>
@stop

View File

@ -3,5 +3,495 @@
@section('content-wrapper')
<div class="content full-page">
<h1>Dashboard</h1>
<div class="dashboard-content">
<div class="dashboard-stats">
<div class="dashboard-card">
<div class="visitor-content">
<div class="title">
<span>NEW VISITORS </span>
</div>
<div class="data">
<span>450 </span>
<span>
<img src="{{asset('themes/default/assets/images/complete.svg')}}" />
</span>
<span class="right">
12.5% Increased
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="visitor-content">
<div class="title">
<span>NEW VISITORS </span>
</div>
<div class="data">
<span>450 </span>
<span>
<img src="{{asset('themes/default/assets/images/complete.svg')}}" />
</span>
<span class="right">
12.5% Increased
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="visitor-content">
<div class="title">
<span>NEW VISITORS </span>
</div>
<div class="data">
<span>450 </span>
<span>
<img src="{{asset('themes/default/assets/images/complete.svg')}}" />
</span>
<span class="right">
12.5% Increased
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="visitor-content">
<div class="title">
<span>NEW VISITORS </span>
</div>
<div class="data">
<span>450 </span>
<span>
<img src="{{asset('themes/default/assets/images/complete.svg')}}" />
</span>
<span class="right">
12.5% Increased
</span>
</div>
</div>
</div>
</div>
<div class="graph-category">
<div class="dashboard-graph">
</div>
<div class="performing-category">
<div class="category">
<div class="title">
<span> TOP PERFORMING CATEGORIES </span>
</div>
<div class="category-info">
<ul>
<li>
<div class="category-list">
<div class="cat-name">
<span> Men </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . 290 Sales </span>
</div>
<div class="horizon-rule">
</div>
</div>
</li>
<li>
<div class="category-list">
<div class="cat-name">
<span> Women </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>375 Products . 350 Sales </span>
</div>
<div class="horizon-rule">
</div>
</div>
</li>
<li>
<div class="category-list">
<div class="cat-name">
<span> Electronics </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>200 Products . 214 Sales </span>
</div>
<div class="horizon-rule">
</div>
</div>
</li>
<li>
<div class="category-list">
<div class="cat-name">
<span> Accessories </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>180 Products . 180 Sales </span>
</div>
<div class="horizon-rule">
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sale-stock">
<div class="sale">
<div class="top-sale">
<div class="title">
<span> TOP SELLING PRODUCTS </span>
</div>
<div class="sale-info">
<ul>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Men's Olive Denim Jacket </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Sales . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Apple iPhone 8 Plus - 64GB </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Sales . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Long Lenngth Printed Shrug </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Black Round Neck T-Shirt for Men </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Men's Linnen Shirt -Regular Fit </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sale">
<div class="top-sale">
<div class="title">
<span> CUSTOMERS WITH MOST SALES </span>
</div>
<div class="sale-info">
<ul>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Emma Wagner </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span> 24 Orders . Revenue $450.00 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Emma Wagner </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span> 24 Orders . Revenue $450.00 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Emma Wagner </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span> 24 Orders . Revenue $450.00 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Emma Wagner </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span> 24 Orders . Revenue $450.00 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Emma Wagner </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span> 24 Orders . Revenue $450.00 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sale">
<div class="top-sale">
<div class="title">
<span> TOP SELLING PRODUCTS </span>
</div>
<div class="sale-info">
<ul>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Men's Olive Denim Jacket </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>7 left </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Apple iPhone 8 Plus - 64GB </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Sales . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Long Lenngth Printed Shrug </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Black Round Neck T-Shirt for Men </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
<li>
<div class="pro-attribute">
<div class="pro-img">
<!-- <span class="icon settings-icon"></span> -->
</div>
<div class="product-description">
<div class="product-name">
<span> Men's Linnen Shirt -Regular Fit </span>
<span class="icon angle-right-icon right-side"></span>
</div>
<div class="product-info">
<span>250 Products . In Stock - 500 </span>
</div>
</div>
</div>
<div class="horizontal-rule">
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
@stop

View File

@ -47,7 +47,7 @@
{{ $currency->name }}
</option>
@endforeach
</select>
</select>
<span class="control-error" v-if="errors.has('target_currency')">@{{ errors.first('target_currency') }}</span>
</div>

View File

@ -1,6 +1,12 @@
@extends('admin::layouts.content')
@section('page_title')
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">

View File

@ -0,0 +1,93 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrate.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.taxrate.create') }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.create') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.configuration.taxrate.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']">
<label for="identifier" class="required">{{ __('admin::app.configuration.taxrate.identifier') }}</label>
<input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ old('identifier') }}"/>
<span class="control-error" v-if="errors.has('identifier')">@{{ errors.first('identifier') }}</span>
</div>
<div class="control-group">
<span class="checkbox">
<input type="checkbox" id="is_zip" name="is_zip">
<label class="checkbox-view" for="is_zip"></label>
Enable Zip Range
</span>
</div>
<div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']">
<label for="zip_from" class="required">{{ __('admin::app.configuration.taxrate.zip_from') }}</label>
<input v-validate="'numeric'" class="control" id="zip_from" name="zip_from" value="{{ old('zip_from') }}"/>
<span class="control-error" v-if="errors.has('zip_from')">@{{ errors.first('zip_from') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']">
<label for="zip_to" class="required">{{ __('admin::app.configuration.taxrate.zip_to') }}</label>
<input v-validate="'numeric'" class="control" id="zip_to" name="zip_to" value="{{ old('zip_to') }}"/>
<span class="control-error" v-if="errors.has('zip_to')">@{{ errors.first('zip_to') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state" class="required">{{ __('admin::app.configuration.taxrate.state') }}</label>
<input v-validate="'required'" class="control" id="state" name="state" value="{{ old('state') }}"/>
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country" class="required">{{ __('admin::app.configuration.taxrate.country') }}</label>
<input v-validate="'required'" class="control" id="country" name="country" value="{{ old('country') }}"/>
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.taxrate.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ old('tax_rate') }}"/>
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,93 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrate.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.taxrate.update', $data['id']) }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.edit.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrate.edit.edit-button-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@method('PUT')
@csrf()
<accordian :title="'{{ __('admin::app.configuration.taxrate.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('identifier') ? 'has-error' : '']">
<label for="identifier" class="required">{{ __('admin::app.configuration.taxrate.identifier') }}</label>
<input v-validate="'required'" class="control" id="identifier" name="identifier" value="{{ $data['identifier'] }}"/>
<span class="control-error" v-if="errors.has('identifier')">@{{ errors.first('identifier') }}</span>
</div>
<div class="control-group">
<span class="checkbox">
<input type="checkbox" id="is_zip" name="is_zip">
<label class="checkbox-view" for="is_zip"></label>
Enable Zip Range
</span>
</div>
<div class="control-group" :class="[errors.has('zip_from') ? 'has-error' : '']">
<label for="zip_from" class="required">{{ __('admin::app.configuration.taxrate.zip_from') }}</label>
<input v-validate="'numeric'" class="control" id="zip_from" name="zip_from" value="{{ $data['zip_from'] }}" />
<span class="control-error" v-if="errors.has('zip_from')">@{{ errors.first('zip_from') }}</span>
</div>
<div class="control-group" :class="[errors.has('zip_to') ? 'has-error' : '']">
<label for="zip_to" class="required">{{ __('admin::app.configuration.taxrate.zip_to') }}</label>
<input v-validate="'numeric'" class="control" id="zip_to" name="zip_to" value="{{ $data['zip_to'] }}" />
<span class="control-error" v-if="errors.has('zip_to')">@{{ errors.first('zip_to') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state" class="required">{{ __('admin::app.configuration.taxrate.state') }}</label>
<input v-validate="'required'" class="control" id="state" name="state" value="{{ $data['state'] }}" />
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country" class="required">{{ __('admin::app.configuration.taxrate.country') }}</label>
<input v-validate="'required'" class="control" id="country" name="country" value="{{ $data['country'] }}" />
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.taxrate.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" value="{{ $data['tax_rate'] }}" />
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,26 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrate.title') }}
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrate.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.taxrate.show') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrate.title') }}
</a>
</div>
</div>
<div class="page-content">
@inject('taxrates', 'Webkul\Admin\DataGrids\TaxRateDataGrid')
{!! $taxrates->render() !!}
</div>
</div>
@endsection

View File

@ -0,0 +1,87 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrule.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.taxrule.create') }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrule.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.create') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
<accordian :title="'{{ __('admin::app.configuration.taxrule.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.configuration.taxrule.select-channel') }}</label>
<select class="control" name="channel_id">
@foreach(core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->id }}">
{{ $channelModel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel')">@{{ errors.first('channel') }}</span>
</div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.configuration.taxrule.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}"/>
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
</div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.configuration.taxrule.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.configuration.taxrule.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description" value="{{ old('description') }}"></textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
<div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']">
<label for="taxrates" class="required">{{ __('admin::app.configuration.taxrule.select-taxrates') }}</label>
<select multiple="multiple" v-validate="'required'" class="control" id="taxrates" name="taxrates[]" value="{{ old('taxrates') }}">
@foreach($taxRates as $taxRate)
<option value="{{ $taxRate['id'] }}">{{ $taxRate['identifier'] }}</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('taxrates')">@{{ errors.first('taxrates') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,99 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.taxrate.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.taxrule.update', $data[0][0]['id']) }}" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.taxrule.edit.title') }}</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.taxrule.edit.edit-button-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
@method('PUT')
<accordian :title="'{{ __('admin::app.configuration.taxrule.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('channel') ? 'has-error' : '']">
<label for="channel" class="required">{{ __('admin::app.configuration.taxrule.select-channel') }}</label>
<select class="control" name="channel">
@foreach(core()->getAllChannels() as $channelModel)
<option @if($data[0][0]['channel_id'] == $channelModel->id) selected @endif value="{{ $channelModel->id }}">
{{ $channelModel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel')">@{{ errors.first('channel') }}</span>
</div>
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code" class="required">{{ __('admin::app.configuration.taxrule.code') }}</label>
<input v-validate="'required'" class="control" id="code" name="code" value="{{ $data[0][0]['code'] }}"/>
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
</div>
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.configuration.taxrule.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ $data[0][0]['name'] }}"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.configuration.taxrule.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description">{{ $data[0][0]['description'] }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
<div class="control-group" :class="[errors.has('taxrates') ? 'has-error' : '']">
<label for="taxrates" class="required">{{ __('admin::app.configuration.taxrule.select-taxrates') }}</label>
@inject('taxRates', 'Webkul\Core\Repositories\TaxRatesRepository')
<select multiple="multiple" class="control" id="taxrates" name="taxrates[]" v-validate="'required'">
@foreach($taxRates->all() as $taxRate)
<option value="{{ $taxRate->id }}"
@foreach($data[1] as $selectedRate)
@if($taxRate->id == $selectedRate['id'])
selected
@endif
@endforeach>
{{ $taxRate->identifier }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('taxrates')">@{{ errors.first('taxrates[]') }}</span>
</div>
</div>
</accordian>
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,22 @@
@extends('admin::layouts.content')
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.configuration.tax.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.taxrule.show') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.tax.add-title') }}
</a>
</div>
</div>
<div class="page-content">
@inject('taxrule','Webkul\Admin\DataGrids\TaxRuleDataGrid')
{!! $taxrule->render() !!}
</div>
</div>
@stop

View File

@ -14,7 +14,7 @@
<h1>{{ __('admin::app.users.sessions.title') }}</h1>
<form method="POST" action="login" @submit.prevent="onSubmit">
<form method="POST" action="{{ route('admin.session.store') }}" @submit.prevent="onSubmit">
@csrf
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
@ -40,14 +40,14 @@
{{ __('admin::app.users.sessions.remember-me') }}
</span>
</div>
<div class="button-group">
<button class="btn btn-xl btn-primary">{{ __('admin::app.users.sessions.submit-btn-title') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@ -6,8 +6,6 @@
@section('content')
@inject ('datagrid', 'Webkul\Admin\Datagrids\User')
<div class="content">
<div class="page-header">
<div class="page-title">

View File

@ -14,9 +14,9 @@ class AttributeTableSeeder extends Seeder
[
'code' => 'sku',
'admin_name' => 'SKU',
'en' => [
'name' => 'SKU'
],
// 'en' => [
// 'name' => 'SKU'
// ],
'type' => 'text',
'position' => 1,
'is_unique' => 1,
@ -29,9 +29,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'name',
'admin_name' => 'Name',
'en' => [
'name' => 'Name'
],
// 'en' => [
// 'name' => 'Name'
// ],
'type' => 'text',
'position' => 2,
'is_required' => 1,
@ -43,9 +43,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'url_key',
'admin_name' => 'URL Key',
'en' => [
'name' => 'URL Key'
],
// 'en' => [
// 'name' => 'URL Key'
// ],
'type' => 'text',
'position' => 3,
'is_unique' => 1,
@ -58,9 +58,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'new_from',
'admin_name' => 'New From',
'en' => [
'name' => 'New From'
],
// 'en' => [
// 'name' => 'New From'
// ],
'type' => 'datetime',
'position' => 4,
'is_required' => 0,
@ -72,9 +72,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'new_to',
'admin_name' => 'New To',
'en' => [
'name' => 'New To'
],
// 'en' => [
// 'name' => 'New To'
// ],
'type' => 'datetime',
'position' => 5,
'is_required' => 0,
@ -86,9 +86,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'visible_individually',
'admin_name' => 'Visible Individually',
'en' => [
'name' => 'Visible Individually'
],
// 'en' => [
// 'name' => 'Visible Individually'
// ],
'type' => 'boolean',
'position' => 6,
'is_required' => 1,
@ -100,9 +100,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'status',
'admin_name' => 'Status',
'en' => [
'name' => 'Status'
],
// 'en' => [
// 'name' => 'Status'
// ],
'type' => 'boolean',
'position' => 7,
'is_required' => 1,
@ -114,9 +114,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'short_description',
'admin_name' => 'Short Description',
'en' => [
'name' => 'Short Description'
],
// 'en' => [
// 'name' => 'Short Description'
// ],
'type' => 'textarea',
'position' => 8,
'is_required' => 1,
@ -128,9 +128,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'description',
'admin_name' => 'Description',
'en' => [
'name' => 'Description'
],
// 'en' => [
// 'name' => 'Description'
// ],
'type' => 'textarea',
'position' => 9,
'is_required' => 1,
@ -142,9 +142,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'price',
'admin_name' => 'Price',
'en' => [
'name' => 'Price'
],
// 'en' => [
// 'name' => 'Price'
// ],
'type' => 'price',
'position' => 10,
'is_required' => 1,
@ -156,9 +156,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'cost',
'admin_name' => 'Cost',
'en' => [
'name' => 'Cost'
],
// 'en' => [
// 'name' => 'Cost'
// ],
'type' => 'price',
'position' => 11,
'is_required' => 0,
@ -170,9 +170,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'special_price',
'admin_name' => 'Special Price',
'en' => [
'name' => 'Special Price'
],
// 'en' => [
// 'name' => 'Special Price'
// ],
'type' => 'price',
'position' => 12,
'is_required' => 0,
@ -184,9 +184,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'special_price_from',
'admin_name' => 'Special Price From',
'en' => [
'name' => 'Special Price From'
],
// 'en' => [
// 'name' => 'Special Price From'
// ],
'type' => 'date',
'position' => 13,
'is_required' => 0,
@ -198,9 +198,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'special_price_to',
'admin_name' => 'Special Price To',
'en' => [
'name' => 'Special Price To'
],
// 'en' => [
// 'name' => 'Special Price To'
// ],
'type' => 'date',
'position' => 14,
'is_required' => 0,
@ -212,9 +212,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'meta_title',
'admin_name' => 'Meta Title',
'en' => [
'name' => 'Meta Description'
],
// 'en' => [
// 'name' => 'Meta Description'
// ],
'type' => 'textarea',
'position' => 15,
'is_required' => 0,
@ -226,9 +226,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'meta_keywords',
'admin_name' => 'Meta Keywords',
'en' => [
'name' => 'Meta Keywords'
],
// 'en' => [
// 'name' => 'Meta Keywords'
// ],
'type' => 'textarea',
'position' => 16,
'is_required' => 0,
@ -240,9 +240,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'meta_description',
'admin_name' => 'Meta Description',
'en' => [
'name' => 'Meta Description'
],
// 'en' => [
// 'name' => 'Meta Description'
// ],
'type' => 'textarea',
'position' => 17,
'is_required' => 0,
@ -254,9 +254,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'width',
'admin_name' => 'Width',
'en' => [
'name' => 'Width'
],
// 'en' => [
// 'name' => 'Width'
// ],
'type' => 'text',
'validation' => 'numeric',
'position' => 18,
@ -269,9 +269,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'height',
'admin_name' => 'Height',
'en' => [
'name' => 'Height'
],
// 'en' => [
// 'name' => 'Height'
// ],
'type' => 'text',
'validation' => 'numeric',
'position' => 19,
@ -284,9 +284,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'depth',
'admin_name' => 'Depth',
'en' => [
'name' => 'Depth'
],
// 'en' => [
// 'name' => 'Depth'
// ],
'type' => 'text',
'validation' => 'numeric',
'position' => 20,
@ -299,9 +299,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'weight',
'admin_name' => 'Weight',
'en' => [
'name' => 'Weight'
],
// 'en' => [
// 'name' => 'Weight'
// ],
'type' => 'text',
'validation' => 'numeric',
'position' => 21,
@ -314,9 +314,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'color',
'admin_name' => 'Color',
'en' => [
'name' => 'Color'
],
// 'en' => [
// 'name' => 'Color'
// ],
'type' => 'select',
'position' => 22,
'is_required' => 0,
@ -356,9 +356,9 @@ class AttributeTableSeeder extends Seeder
], [
'code' => 'size',
'admin_name' => 'Size',
'en' => [
'name' => 'Size'
],
// 'en' => [
// 'name' => 'Size'
// ],
'type' => 'select',
'position' => 23,
'is_required' => 0,

View File

@ -21,7 +21,7 @@ class AttributeController extends Controller
* @var array
*/
protected $_config;
/**
* AttributeRepository object
*
@ -37,6 +37,8 @@ class AttributeController extends Controller
*/
public function __construct(Attribute $attribute)
{
$this->middleware('admin');
$this->attribute = $attribute;
$this->_config = request('_config');
@ -109,7 +111,7 @@ class AttributeController extends Controller
'admin_name' => 'required',
'type' => 'required'
]);
$this->attribute->update(request()->all(), $id);
session()->flash('success', 'Attribute updated successfully.');

View File

@ -22,7 +22,7 @@ class AttributeFamilyController extends Controller
* @var array
*/
protected $_config;
/**
* AttributeFamilyRepository object
*
@ -38,6 +38,8 @@ class AttributeFamilyController extends Controller
*/
public function __construct(AttributeFamily $attributeFamily)
{
$this->middleware('admin');
$this->attributeFamily = $attributeFamily;
$this->_config = request('_config');
@ -62,7 +64,7 @@ class AttributeFamilyController extends Controller
public function create(Attribute $attribute)
{
$attributeFamily = $this->attributeFamily->with(['attribute_groups.custom_attributes'])->findOneByField('code', 'default');
$custom_attributes = $attribute->all(['id', 'code', 'admin_name', 'type']);
return view($this->_config['view'], compact('custom_attributes', 'attributeFamily'));
@ -116,7 +118,7 @@ class AttributeFamilyController extends Controller
'code' => ['required', 'unique:attribute_families,code,' . $id, new \Webkul\Core\Contracts\Validations\Code],
'name' => 'required'
]);
$this->attributeFamily->update(request()->all(), $id);

View File

@ -4,6 +4,7 @@ namespace Webkul\Attribute\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use Webkul\User\Http\Middleware\RedirectIfNotAdmin;
class AttributeServiceProvider extends ServiceProvider
{
@ -14,6 +15,8 @@ class AttributeServiceProvider extends ServiceProvider
*/
public function boot(Router $router)
{
$router->aliasMiddleware('admin', RedirectIfNotAdmin::class);
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
@ -24,6 +27,6 @@ class AttributeServiceProvider extends ServiceProvider
*/
public function register()
{
}
}

View File

@ -0,0 +1,26 @@
{
"name": "webkul/laravel-cart",
"description": "Cart Package for customer.",
"license": "MIT",
"authors": [
{
"name": "prashant-webkul",
"email": "prashant.singh852@webkul.com"
}
],
"require": {},
"autoload": {
"psr-4": {
"Webkul\\Cart\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Webkul\\Cart\\Providers\\CartServiceProvider"
],
"aliases": {}
}
},
"minimum-stability": "dev"
}

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCartTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cart', function (Blueprint $table) {
$table->increments('id');
$table->integer('customer_id')->unsigned()->nullable();
$table->foreign('customer_id')->references('id')->on('customers');
$table->string('session_id')->nullable();
$table->integer('channel_id')->unsigned();
$table->foreign('channel_id')->references('id')->on('channels');
$table->string('coupon_code')->nullable();
$table->boolean('is_gift')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cart');
}
}

View File

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCartItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cart_items', function (Blueprint $table) {
$table->increments('id');
$table->integer('product_id')->unsigned();
$table->foreign('product_id')->references('id')->on('products');
$table->integer('quantity')->unsigned()->default(1);
$table->integer('cart_id')->unsigned();
$table->foreign('cart_id')->references('id')->on('cart');
$table->integer('tax_category_id')->unsigned()->nullable();
$table->foreign('tax_category_id')->references('id')->on('tax_categories');
$table->string('coupon_code')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cart_items');
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace Webkul\Cart\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Cart\Repositories\CartRepository;
use Webkul\Cart\Repositories\CartItemsRepository;
use Session;
/**
* Cart controller for the customer
* and guest users for adding and
* removing the products in the
* cart.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CartController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $cart;
public function __construct(CartRepository $cart)
{
$this->middleware(['customer', 'guest']);
$this->_config = request('_config');
$this->cart = $cart;
}
public function add() {
return "Adding Items to Cart";
}
}

View File

@ -0,0 +1,45 @@
<?php
namespace Webkul\Cart\Http\Controllers;
use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Auth;
/**
* Chekout controller for the customer
* and guest for placing order
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CheckoutController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
public function __construct()
{
// $this->middleware(['customer', 'guest']);
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$customer_id = auth()->guard('customer')->user();
return view($this->_config['view'],compact('customer_id'));
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace Webkul\Cart\Models;
class Cart
{
protected $table = 'cart';
protected $fillable = ['customer_id','session_id','channel_id','coupon_code','is_gift'];
protected $hidden = ['coupon_code'];
}

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Cart\Models;
class CartItems
{
protected $table = 'cart_items';
protected $fillable = ['product_id','quantity','cart_id','tax_category_id','coupon_code'];
}

View File

@ -0,0 +1,28 @@
<?php
namespace Webkul\Cart\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
class CartServiceProvider extends ServiceProvider
{
public function boot(Router $router)
{
// $router->aliasMiddleware('customer', RedirectIfNotCustomer::class);
$this->loadMigrationsFrom(__DIR__ . '/../Database/migrations');
}
/**
* Register services.
*
* @return void
*/
public function register()
{
// $this->app->bind('datagrid', 'Webkul\Ui\DataGrid\DataGrid');
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Cart\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Cart Items Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CartItemsRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Cart\Models\CartItems';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$cartitems = $this->model->create($data);
return $cartitems;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$cartitems = $this->find($id);
$cartitems->update($data);
return $cartitems;
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Cart\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Cart Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CartRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Cart\Models\Cart';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$cart = $this->model->create($data);
return $cart;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$cart = $this->find($id);
$cart->update($data);
return $cart;
}
}

View File

@ -20,7 +20,7 @@ class CategoryController extends Controller
* @var array
*/
protected $_config;
/**
* CategoryRepository object
*
@ -36,6 +36,8 @@ class CategoryController extends Controller
*/
public function __construct(Category $category)
{
$this->middleware('admin');
$this->category = $category;
$this->_config = request('_config');

View File

@ -5,6 +5,7 @@ namespace Webkul\Category\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Routing\Router;
use Webkul\User\Http\Middleware\RedirectIfNotAdmin;
class CategoryServiceProvider extends ServiceProvider
{
@ -15,6 +16,8 @@ class CategoryServiceProvider extends ServiceProvider
*/
public function boot(Router $router)
{
$router->aliasMiddleware('admin', RedirectIfNotAdmin::class);
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}
@ -25,6 +28,6 @@ class CategoryServiceProvider extends ServiceProvider
*/
public function register()
{
}
}

View File

@ -6,6 +6,8 @@ use Carbon\Carbon;
use Webkul\Core\Models\Channel as ChannelModel;
use Webkul\Core\Models\Locale as LocaleModel;
use Webkul\Core\Models\Currency as CurrencyModel;
use Webkul\Core\Models\TaxCategory as TaxCategory;
use Webkul\Core\Models\TaxRate as TaxRate;
class Core
{
@ -138,8 +140,10 @@ class Core
$channel = $this->getCurrentChannel();
$currencyCode = $channel->base_currency->code;
$currencyCode = $channel->base_currency;
// $currencyCode = $channel->base_currency->code;
return currency($price, $currencyCode);
}
@ -211,6 +215,27 @@ class Core
// $timezonelist = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL);
/**
* Find all the tax
* rates associated
* with a tax category.
*
* @return Array
*/
public function withRates($id) {
return TaxCategory::findOrFail($id)->tax_rates;
}
/**
* To fetch all
* tax rates.
*
* @return Collection
*/
public function getAllTaxRates() {
return TaxRate::all();
}
/**
* Format date using current channel.

View File

@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTaxCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tax_categories', function (Blueprint $table) {
$table->increments('id');
$table->integer('channel_id')->unsigned();
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
$table->string('code')->unique();
$table->string('name')->unique();
$table->longtext('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tax_rules');
}
}

View File

@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTaxRatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tax_rates', function (Blueprint $table) {
$table->increments('id');
$table->string('identifier')->unique();
$table->boolean('is_zip_from')->default(0);
$table->integer('zip_from')->unsigned()->nullable();
$table->integer('zip_to')->unsigned()->nullable();
$table->string('state');
$table->string('country');
$table->float('tax_rate', 6, 4);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tax_rates');
}
}

View File

@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTaxMappingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tax_categories_tax_rates', function (Blueprint $table) {
$table->increments('id');
$table->integer('tax_category_id')->unsigned();
$table->foreign('tax_category_id')->references('id')->on('tax_categories')->onDelete('cascade');
$table->integer('tax_rate_id')->unsigned();
$table->foreign('tax_rate_id')->references('id')->on('tax_rates')->onDelete('cascade');
$table->unique(['tax_category_id', 'tax_rate_id'], 'tax_map_index_unique');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tax_map');
}
}

View File

@ -21,7 +21,7 @@ class ChannelController extends Controller
* @var array
*/
protected $_config;
/**
* ChannelRepository object
*
@ -37,6 +37,8 @@ class ChannelController extends Controller
*/
public function __construct(Channel $channel)
{
$this->middleware('admin');
$this->channel = $channel;
$this->_config = request('_config');

View File

@ -20,7 +20,7 @@ class CountryController extends Controller
* @var array
*/
protected $_config;
/**
* CountryRepository object
*
@ -36,6 +36,8 @@ class CountryController extends Controller
*/
public function __construct(Country $country)
{
$this->middleware('admin');
$this->country = $country;
$this->_config = request('_config');

View File

@ -20,7 +20,7 @@ class CurrencyController extends Controller
* @var array
*/
protected $_config;
/**
* CurrencyRepository object
*
@ -36,6 +36,8 @@ class CurrencyController extends Controller
*/
public function __construct(Currency $currency)
{
$this->middleware('admin');
$this->currency = $currency;
$this->_config = request('_config');
@ -81,7 +83,7 @@ class CurrencyController extends Controller
return redirect()->route($this->_config['redirect']);
}
/**
* Remove the specified resource from storage.
*

View File

@ -0,0 +1,141 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Webkul\Customer\Repositories\CustomerRepository as Customer;
use Webkul\Customer\Repositories\CustomerGroupRepository as CustomerGroup;
/**
* Customer controlller for the customer
* to show customer data on admin login
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* CustomerRepository object
*
* @var array
*/
protected $customer;
/**
* CustomerGroupRepository object
*
* @var array
*/
protected $customerGroup;
/**
* Create a new controller instance.
*
* @param Webkul\Customer\Repositories\CustomerRepository as customer;
* @param Webkul\Customer\Repositories\CustomerGroupRepository as customerGroup;
* @return void
*/
public function __construct(Customer $customer , CustomerGroup $customerGroup )
{
$this->_config = request('_config');
$this->customer = $customer;
$this->customerGroup = $customerGroup;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view($this->_config['view']);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$customerGroup = $this->customerGroup->all();
return view($this->_config['view'],compact('customerGroup'));
}
/**
* Store a newly created resource in storage.
*
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$request->validate([
'first_name' => 'string|required',
'last_name' => 'string|required',
'email' => 'email|required',
]);
$data=$request->all();
$password = bcrypt(rand(100000,10000000));
$data['password']=$password;
$this->customer->create($data);
session()->flash('success', 'Customer created successfully.');
return redirect()->route($this->_config['redirect']);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$customer = $this->customer->findOneWhere(['id'=>$id]);
$customerGroup = $this->customerGroup->all();
return view($this->_config['view'],compact('customer','customerGroup'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this->customer->update(request()->all(),$id);
session()->flash('success', 'Customer updated successfully.');
return redirect()->route($this->_config['redirect']);
}
}

View File

@ -21,14 +21,14 @@ class ExchangeRateController extends Controller
* @var array
*/
protected $_config;
/**
* ExchangeRateRepository object
*
* @var array
*/
protected $exchangeRate;
/**
* CurrencyRepository object
*
@ -45,6 +45,8 @@ class ExchangeRateController extends Controller
*/
public function __construct(ExchangeRate $exchangeRate, Currency $currency)
{
$this->middleware('admin');
$this->exchangeRate = $exchangeRate;
$this->currency = $currency;
@ -129,7 +131,7 @@ class ExchangeRateController extends Controller
'target_currency' => 'required',
'ratio' => 'required|numeric'
]);
$this->exchangeRate->update(request()->all(), $id);
session()->flash('success', 'Exchange rate updated successfully.');

View File

@ -20,7 +20,7 @@ class LocaleController extends Controller
* @var array
*/
protected $_config;
/**
* LocaleRepository object
*
@ -36,6 +36,8 @@ class LocaleController extends Controller
*/
public function __construct(Locale $locale)
{
$this->middleware('admin');
$this->locale = $locale;
$this->_config = request('_config');

View File

@ -0,0 +1,81 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Product\Repositories\ProductRepository as Product;
use Webkul\Product\Repositories\ProductReviewRepository as ProductReview;
/**
* Review controller
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class ReviewController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* ProductRepository object
*
* @var array
*/
protected $product;
/**
* ProductReviewRepository object
*
* @var array
*/
protected $productReview;
/**
* Create a new controller instance.
*
* @param Webkul\Product\Repositories\ProductRepository $product
* @param Webkul\Product\Repositories\ProductReviewRepository $productReview
* @return void
*/
public function __construct(Product $product, ProductReview $productReview)
{
$this->product = $product;
$this->productReview = $productReview;
$this->_config = request('_config');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request , $id)
{
$this->validate(request(), [
'comment' => 'required',
]);
$input=$request->all();
$input['product_id']=$id;
$input['customer_id']=1;
$this->productReview->create($input);
session()->flash('success', 'Review submitted successfully.');
return redirect()->route($this->_config['redirect']);
}
}

View File

@ -0,0 +1,177 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Channel\Channel as Channel;
use Webkul\Core\Repositories\TaxCategoriesRepository as TaxRule;
use Webkul\Core\Repositories\TaxRatesRepository as TaxRate;
use Webkul\Core\Repositories\TaxMapRepository as TaxMap;
/**
* Tax controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxCategoryController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* Contains the current
* channel.
*
* @var string
*/
protected $currentChannelId;
/**
* Tax Rule Repository object
*
* @var array
*/
protected $taxRule;
/**
* Create a new controller instance.
*
* @param Webkul\Core\Repositories\TaxCategoriesRepository $taxRule
* @return void
*/
public function __construct(TaxRule $taxRule, TaxRate $taxRate, TaxMap $taxMap)
{
$this->middleware('admin');
$this->currentChannelId = core()->getCurrentChannel()->id;
$this->taxRule = $taxRule;
$this->taxRate = $taxRate;
$this->taxMap = $taxMap;
$this->_config = request('_config');
}
/**
* Function to show
* the tax rule form
*
* @return view
*/
public function show()
{
return view($this->_config['view'])->with('taxRates', $this->taxRate->all());
}
/**
* Function to create
* the tax rule.
*
* @return view
*/
public function create()
{
$data = request()->input();
$this->validate(request(), [
'code' => 'required|string|unique:tax_categories,id',
'name' => 'required|string|unique:tax_categories,name',
'description' => 'required|string'
]);
if($currentTaxRule = $this->taxRule->create(request()->input())) {
$allTaxRules = $data['taxrates'];
$this->taxRule->onlyAttach($currentTaxRule->id, $allTaxRules);
session()->flash('success', 'New Tax Rule Created');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Cannot create the tax rule');
}
return view($this->_config['view']);
}
/**
* To show the edit
* form form the tax
* rule
*
* @return view
*/
public function edit($id) {
$taxRates = core()->withRates($id)->toArray();
$taxRule = $this->taxRule->findByField('id', $id)->toArray();
return view($this->_config['view'])->with('data', [$taxRule, $taxRates]);
}
/**
* To update the
* tax rule
*
* @return view
*/
public function update($id) {
//return the tax rule data with the mapping table data also,
//allow the user to change the tax rates associated with the
// rule also.
$this->validate(request(), [
'channel' => 'required|numeric',
'code' => 'required|string|unique:tax_categories,id,'.$id,
'name' => 'required|string|unique:tax_categories,name,'.$id,
'description' => 'required|string',
'taxrates' => 'array|required'
]);
$data['channel_id'] = request()->input('channel');
$data['code'] = request()->input('code');
$data['name'] = request()->input('name');
$data['description'] = request()->input('description');
if($this->taxRate->update($data, $id)) {
$this->taxRule->syncAndDetach($id, request()->input('taxrates'));
session()->flash('success', 'Tax Category is successfully edited.');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Tax Category Cannot be Updated Successfully.');
return redirect()->back();
}
}
/**
* Destroy a tax rule
*
* @return mixed
*/
public function destroy($id) {
if($this->taxRule()->delete($id)) {
session()->flash('success', 'The tax rule is successfully deleted');
return redirect()->back();
}
}
}

View File

@ -0,0 +1,92 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Core\Repositories\ChannelRepository as Channel;
use Webkul\Core\Repositories\TaxCategoriesRepository as TaxRule;
use Webkul\Core\Repositories\TaxRatesRepository as TaxRate;
use Webkul\Core\Repositories\TaxMapRepository as TaxMap;
/**
* Tax controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* ChannelRepository object
*
* @var array
*/
protected $channel;
/**
* Tax Rule Repository object
*
* @var array
*/
protected $taxRule;
/**
* Tax Rate Repository object
*
* @var array
*/
protected $taxRate;
/**
* Tax Map Repository object
*
* @var array
*/
protected $taxMap;
/**
* Create a new controller instance.
*
* @param Webkul\Core\Repositories\ChannelRepository $channel
* @param Webkul\Core\Repositories\TaxCategoriesRepository $taxRule
* @param Webkul\Core\Repositories\TaxRatesRepository $taxRate
* @param Webkul\Core\Repositories\TaxMapRepository $taxMap
* @return void
*/
public function __construct(Channel $channel, TaxRule $taxRule, TaxRate $taxRate, TaxMap $taxMap)
{
$this->middleware('admin');
$this->channel = $channel;
$this->taxRule = $taxRule;
$this->taxRate = $taxRate;
$this->taxMap = $taxMap;
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view($this->_config['view']);
}
}

View File

@ -0,0 +1,146 @@
<?php
namespace Webkul\Core\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Core\Repositories\TaxRatesRepository as TaxRate;
/**
* Tax controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxRateController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* Tax Rate Repository object
*
* @var array
*/
protected $taxRate;
/**
* Create a new controller instance.
*
* @param Webkul\Core\Repositories\TaxRatesRepository $taxRate
* @return void
*/
public function __construct(TaxRate $taxRate)
{
$this->middleware('admin');
$this->taxRate = $taxRate;
$this->_config = request('_config');
}
/**
* Display a listing
* resource for the
* available tax rates.
*
* @return mixed
*/
public function index() {
return view($this->_config['view']);
}
/**
* Display a create
* form for tax rate
*
* @return view
*/
public function show()
{
return view($this->_config['view']);
}
/**
* Create the tax rate
*
* @return mixed
*/
public function create() {
$this->validate(request(), [
'identifier' => 'required|string|unique:tax_rates,identifier',
'is_zip' => 'sometimes|confirmed',
'zip_from' => 'nullable|numeric|required_with:is_zip',
'zip_to' => 'nullable|numeric|required_with:is_zip,zip_from',
'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric'
]);
if($this->taxRate->create(request()->input())) {
session()->flash('success', 'Tax Rate Created Successfully');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Cannot Create Tax Rate');
return redirect()->back();
}
return redirect()->back();
}
/**
* Show the edit form
* for the previously
* created tax rates.
*
* @return mixed
*/
public function edit($id) {
$data = collect($this->taxRate->findOneByField('id', $id));
return view($this->_config['view'])->with('data', $data);
}
/**
* Edit the previous
* tax rate
*
* @return mixed
*/
public function update($id) {
$this->validate(request(), [
'identifier' => 'required|string|unique:tax_rates,identifier,'.$id,
'is_zip' => 'sometimes|confirmed',
'zip_from' => 'nullable|numeric|required_with:is_zip',
'zip_to' => 'nullable|numeric|required_with:is_zip,zip_from',
'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric'
]);
if($this->taxRate->update(request()->input(), $id)) {
session()->flash('success', 'Tax Rate Updated Successfully');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Cannot Create Tax Rate');
return redirect()->back();
}
return redirect()->back();
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Core\Models\TaxRate;
use Webkul\Core\Models\TaxMap;
class TaxCategory extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'tax_categories';
protected $fillable = [
'channel_id' ,'code', 'name' ,'description'
];
//for joining the two way pivot table
public function tax_rates() {
return $this->belongsToMany(TaxRate::class, 'tax_categories_tax_rates', 'tax_category_id')->withPivot('id');
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Core\Models\TaxCategory;
use Webkul\Core\Models\TaxRate;
class TaxMap extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'tax_categories_tax_rates';
protected $fillable = [
'tax_category_id', 'tax_rate_id'
];
}

View File

@ -0,0 +1,25 @@
<?php
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Core\Models\TaxCategory;
class TaxRate extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'tax_rates';
protected $fillable = [
'identifier', 'is_zip_from', 'zip_from', 'zip_to', 'state', 'country', 'tax_rate'
];
public function tax_categories() {
return $this->belongsToMany(TaxCategory::class, 'tax_categories_tax_rates', 'tax_rate_id', 'id');
}
}

View File

@ -1,7 +1,5 @@
<?php
namespace Webkul\Core\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
use Illuminate\Routing\Router;
@ -9,7 +7,6 @@ use Illuminate\Foundation\AliasLoader;
use Webkul\Core\Http\Middleware\Locale;
use Webkul\Core\Core;
use Webkul\Core\Facades\CoreFacade;
class CoreServiceProvider extends ServiceProvider
{
/**
@ -20,22 +17,15 @@ class CoreServiceProvider extends ServiceProvider
public function boot(Router $router)
{
include __DIR__ . '/../Http/helpers.php';
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'core');
$router->aliasMiddleware('locale', Locale::class);
// $this->publishes([
// __DIR__ . '/../../publishable/lang' => public_path('vendor/webkul/core/lang'),
// ], 'public');
Validator::extend('slug', 'Webkul\Core\Contracts\Validations\Slug@passes');
Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes');
}
/**
* Register services.
*
@ -45,7 +35,6 @@ class CoreServiceProvider extends ServiceProvider
{
$this->registerFacades();
}
/**
* Register Bouncer as a singleton.
*
@ -55,7 +44,6 @@ class CoreServiceProvider extends ServiceProvider
{
$loader = AliasLoader::getInstance();
$loader->alias('core', CoreFacade::class);
$this->app->singleton('core', function () {
return new Core();
});

View File

@ -1,7 +1,7 @@
<?php
<?php
namespace Webkul\Core\Repositories;
use Webkul\Core\Eloquent\Repository;
/**

View File

@ -28,7 +28,7 @@ class SliderRepository extends Repository
*/
public function create(array $data)
{
$image = request()->hasFile('image');
$image = request()->file('image');
$image_name = uniqid(20).'.'.$image->getClientOriginalExtension();

View File

@ -0,0 +1,82 @@
<?php
namespace Webkul\Core\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Tax Rule Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxCategoriesRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Core\Models\TaxCategory';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$taxRule = $this->model->create($data);
return $taxRule;
}
/**
* @param array $data
* @param $id
* @param string $attribute
*
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$taxRule = $this->find($id);
$taxRule->update($data);
return $taxmap;
}
/**
* Method to attach
* associations
*
* @return mixed
*/
public function onlyAttach($id, $taxRates) {
foreach($taxRates as $key => $value) {
$this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]);
}
}
/**
* Method to detach
* and attach the
* associations
*
* @return mixed
*/
public function syncAndDetach($id, $taxRates) {
$this->model->findOrFail($id)->tax_rates()->detach();
foreach($taxRates as $key => $value) {
$this->model->findOrFail($id)->tax_rates()->attach($id, ['tax_category_id' => $id, 'tax_rate_id' => $value]);
}
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace Webkul\Core\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Tax Mapping Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxMapRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Core\Models\TaxMap';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$taxMap = $this->model->create($data);
return $taxMap;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$taxMap = $this->find($id);
$taxMap->update($data);
return $taxMap;
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace Webkul\Core\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Tax Rate Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class TaxRatesRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Core\Models\TaxRate';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$taxRate = $this->model->create($data);
return $taxRate;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$taxRate = $this->find($id);
$taxRate->update($data);
return $taxRate;
}
}

View File

@ -21,6 +21,7 @@ class CreateCustomersTable extends Migration
$table->date('date_of_birth')->nullable();
$table->string('phone')->unique()->nullable();
$table->string('email')->unique();
$table->tinyInteger('status')->default(1);
$table->string('password');
$table->integer('customer_group_id')->unsigned()->nullable();
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade');

View File

@ -0,0 +1,47 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\CustomerAddressRepository;
use Auth;
/**
* Account Controlller for the customers
* basically will control the landing
* behavior for custome and group of
* customers.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class AccountController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
protected $address;
public function __construct(CustomerRepository $customer, CustomerAddressRepository $address)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
$this->address = $address;
}
public function index() {
return view($this->_config['view']);
}
}

View File

@ -0,0 +1,192 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\CustomerAddressRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class AddressController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
protected $address;
public function __construct(CustomerRepository $customer, CustomerAddressRepository $address)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
$this->address = $address;
}
/**
* Getting logged in
* customer helper
* @return Array
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
/**
* Getting logged in
* customer address
* helper
* @return Array
*/
private function getAddress($id) {
$address = collect($this->address->findOneWhere(['customer_id'=>$id]));
return $address;
}
/**
* Address Route
* index page
* @return View
*/
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
$address = $this->getAddress($id);
return view($this->_config['view'])->with('address', $address);
}
/**
* Show the address
* create form
* @return View
*/
public function show() {
return view($this->_config['view']);
}
/**
* Create a new
* address for
* customer.
*
* @return View
*/
public function create() {
$id = auth()->guard('customer')->user()->id;
$data = collect(request()->input())->except('_token')->toArray();
$this->validate(request(), [
'address1' => 'string|required',
'address2' => 'string|required',
'country' => 'string|required',
'state' => 'string|required',
'city' => 'string|required',
'postcode' => 'numeric|required',
]);
$cust_id['customer_id'] = $id;
$data = array_merge($cust_id, $data);
$address = $this->getAddress($id);
if(count($address) == 0 || $address->isEmpty()) {
if($this->address->create($data)) {
session()->flash('success', 'Address have been successfully added.');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Address cannot be added.');
return redirect()->back();
}
} else {
session()->flash('error', 'Cannot create a new address due to previously existing address');
return redirect()-route('customer.address.edit');
}
}
/**
* For editing the
* existing address
* of the customer
*
* @return View
*/
public function showEdit() {
$id = auth()->guard('customer')->user()->id;
$address = $this->getAddress($id);
return view($this->_config['view'])->with('address', $address);
}
public function edit() {
$id = auth()->guard('customer')->user()->id;
$this->validate(request(), [
'address1' => 'string|required',
'address2' => 'string|required',
'country' => 'string|required',
'state' => 'string|required',
'city' => 'string|required',
'postcode' => 'numeric|required',
]);
$data = collect(request()->input())->except('_token')->toArray();
$address = $this->getAddress($id);
if($this->address->update($data, $id)) {
Session()->flash('success','Address Updated Successfully.');
return redirect()->route('customer.address.index');
} else {
Session()->flash('success','Address Cannot be Updated.');
return redirect()->route('customer.address.edit');
}
}
}

View File

@ -4,8 +4,9 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Models\Customer;
use Auth;
/**
* Customer controlller for the customer
@ -24,10 +25,16 @@ class CustomerController extends Controller
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct()
public function __construct(CustomerRepository $customer)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
}
/**
@ -36,23 +43,108 @@ class CustomerController extends Controller
* authentication
* @return view
*/
private function getCustomer($id)
{
$customer = collect(Customer::find($id));
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function profile()
{
/**
* Taking the customer
* to profile details
* page
* @return View
*/
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function editProfile()
{
/**
* For loading the
* edit form page.
*
* @return View
*/
public function editIndex() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
/**
* Edit function
* for editing customer
* profile.
*
* @return Redirect.
*/
public function edit() {
$id = auth()->guard('customer')->user()->id;
$this->validate(request(), [
'first_name' => 'string',
'last_name' => 'string',
'gender' => 'required',
'date_of_birth' => 'date',
'phone' => 'string|size:10',
'email' => 'email|unique:customers,email,'.$id,
'password' => 'confirmed|required_if:oldpassword,!=,null'
]);
$data = collect(request()->input())->except('_token')->toArray();
if($data['oldpassword'] == null) {
$data = collect(request()->input())->except(['_token','password','password_confirmation','oldpassword'])->toArray();
if($this->customer->update($data, $id)) {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
} else {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
}
} else {
$data = collect(request()->input())->except(['_token','oldpassword'])->toArray();
$data['password'] = bcrypt($data['password']);
if($this->customer->update($data, $id)) {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
} else {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
}
}
}
public function orders() {
return view($this->_config['view']);
}
public function wishlist() {
return view($this->_config['view']);
}
public function reviews() {
return view($this->_config['view']);
}
public function address() {
return view($this->_config['view']);
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrdersController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function orders() {
return view($this->_config['view']);
}
}

View File

@ -5,10 +5,10 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Webkul\Customer\Models\Customer;
use Webkul\Customer\Repositories\CustomerRepository;
/**
* Dashboard controller
* Registration controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
@ -21,10 +21,13 @@ class RegistrationController extends Controller
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct()
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
}
/**
@ -43,25 +46,30 @@ class RegistrationController extends Controller
*/
public function create(Request $request)
{
// return $request->except('_token'); //don't let csrf token to be openly printed
$request->validate([
'first_name' => 'string|required',
'last_name' => 'string|required',
'email' => 'email|required',
'password' => 'confirmed|min:8|required'
'password' => 'confirmed|min:6|required'
]);
$customer = new \Webkul\Customer\Models\Customer();
$customer->first_name = $request->first_name;
$customer->last_name = $request->last_name;
$customer->email = $request->email;
$customer->password = bcrypt($request->password);
// dd('hello1');
if ($customer->save()) {
$registrationData = $request->except('_token');
if ($this->customer->create($registrationData)) {
session()->flash('success', 'Account created successfully.');
return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', 'Cannot Create Your Account.');
return redirect()->back();
}
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class ReviewsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function reviews() {
return view($this->_config['view']);
}
}

View File

@ -24,12 +24,20 @@ class SessionController extends Controller
public function __construct()
{
$this->middleware('customer')->except(['show','create']);
$this->_config = request('_config');
}
public function show()
{
return view($this->_config['view']);
if(auth()->guard('customer')->check()) {
return redirect()->route('customer.account.index');
} else {
return view($this->_config['view']);
}
}
public function create(Request $request)
@ -39,15 +47,13 @@ class SessionController extends Controller
'password' => 'required'
]);
// $remember = request('remember');
if (!auth()->guard('customer')->attempt(request(['email', 'password']))) {
dd('cannot be authorized');
session()->flash('error', 'Please check your credentials and try again.');
session()->flash('error', 'Please check your credentials and try again.');
return back();
}
return redirect()->route($this->_config['redirect']);
return redirect()->intended(route($this->_config['redirect']));
}
public function destroy($id)
@ -55,4 +61,4 @@ class SessionController extends Controller
auth()->guard('customer')->logout();
return redirect()->route($this->_config['redirect']);
}
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class WishlistController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->middleware('customer');
$this->_config = request('_config');
$this->customer = $customer;
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function wishlist() {
return view($this->_config['view']);
}
}

View File

@ -9,6 +9,13 @@ use Illuminate\Support\Facades\URL;
class Menu
{
public $items = array();
public $current;
public $currentKey;
public function __construct() {
$this->current = Request::url();
}
public static function create($callback)
{
@ -26,4 +33,19 @@ class Menu
];
array_push($this->items, $item);
}
/**
* Method to find the active links
*
* @param array $item Item that
* needs to be checked if active
* @return string
*/
public function getActive($item)
{
$url = trim($item['url'], '/');
if ((strpos($this->current, $url) !== false) || (strpos($this->currentKey, $item['key']) === 0)) {
return 'active';
}
}
}

View File

@ -4,6 +4,7 @@ namespace Webkul\Customer\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Webkul\Customer\Models\CustomersGroups;
// use Webkul\User\Notifications\AdminResetPassword;
@ -15,9 +16,27 @@ class Customer extends Authenticatable
use Notifiable;
protected $table = 'customers';
protected $fillable = ['first_name', 'last_name', 'gender', 'date_of_birth','phone','email','password','customer_group_id','subscribed_to_news_letter'];
protected $hidden = ['password','remember_token'];
protected $with = ['customerGroup'];
/**
* Get the customer full name.
*/
public function getNameAttribute() {
return ucfirst($this->first_name) . ' ' . ucfirst($this->last_name);
}
/**
* Get the customer group that owns the customer.
*/
public function customerGroup()
{
return $this->belongsTo(CustomersGroups::class);
}
}

View File

@ -6,4 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class CustomersAddress extends Model
{
protected $table = 'customer_addresses';
protected $fillable = ['customer_id' ,'address1', 'address2', 'country', 'state', 'city', 'postcode'];
}

View File

@ -34,8 +34,17 @@ class EventServiceProvider extends ServiceProvider
});
Event::listen('customer.menu.build', function ($menu) {
$menu->add('customer.account.profile', 'Profile');
$menu->add('customer.account.profile', 'Wishlist');
$menu->add('customer.profile.index', 'Profile');
$menu->add('customer.orders.index', 'Orders');
$menu->add('customer.address.index', 'Address');
$menu->add('customer.reviews.index', 'Reviews');
$menu->add('customer.wishlist.index', 'Wishlist');
});
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Customer\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Customer Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerAddressRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Customer\Models\CustomersAddress';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$address = $this->model->create($data);
return $address;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$address = $this->findOneByField('customer_id', $id);
$address->update($data);
return $address;
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Customer\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* CustomerGroup Reposotory
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerGroupRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Customer\Models\CustomersGroups';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$customer = $this->model->create($data);
return $customer;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$customer = $this->find($id);
$customer->update($data);
return $customer;
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Customer\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Customer Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Customer\Models\Customer';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$customer = $this->model->create($data);
return $customer;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$customer = $this->find($id);
$customer->update($data);
return $customer;
}
}

View File

@ -5,6 +5,7 @@ namespace Webkul\Inventory\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Routing\Router;
use Webkul\User\Http\Middleware\RedirectIfNotAdmin;
class InventoryServiceProvider extends ServiceProvider
{
@ -15,6 +16,8 @@ class InventoryServiceProvider extends ServiceProvider
*/
public function boot(Router $router)
{
$router->aliasMiddleware('admin', RedirectIfNotAdmin::class);
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
}

View File

@ -85,10 +85,10 @@ class ProductForm extends FormRequest
foreach ($attributes as $attribute) {
if($attribute->code == 'sku')
continue;
if($product->type == 'configurable' && in_array($attribute->code, ['price', 'cost', 'special_price', 'special_price_from', 'special_price_to', 'width', 'height', 'depth', 'weight']))
continue;
$validations = [];
if($attribute->is_required) {
array_push($validations, 'required');

View File

@ -121,7 +121,7 @@ class Product extends Model
{
return $this->belongsToMany(self::class, 'product_cross_sells');
}
/**
* @param string $key
*
@ -155,7 +155,7 @@ class Product extends Model
* @return mixed
*/
public function getAttribute($key)
{
{
if (!method_exists(self::class, $key) && !in_array($key, ['parent_id', 'attribute_family_id']) && !isset($this->attributes[$key])) {
if (isset($this->id) && $this->isCustomAttribute($key)) {
$this->attributes[$key] = '';
@ -242,5 +242,5 @@ class Product extends Model
{
return new \Webkul\Product\Database\Eloquent\Builder($query);
}
}

Some files were not shown because too many files have changed in this diff Show More