Disabled customer email verfication and removed the phone field from the customer model
This commit is contained in:
parent
6da6e55457
commit
6e966384e5
|
|
@ -63,7 +63,7 @@ Bagisto is using power of both of these frameworks and making best out of it out
|
|||
|
||||
**Run this Command** to download the project on to your local machine or server:
|
||||
|
||||
>> Note: If you have downloaded zip file then ignore this.
|
||||
> Note: If you have downloaded zip file then ignore this.
|
||||
|
||||
~~~
|
||||
composer create-project bagisto/bagisto
|
||||
|
|
@ -89,12 +89,12 @@ default.
|
|||
|
||||
**Run these Commands Below**
|
||||
|
||||
>> Run this command, in case installing from the zip else skip this command (no need to run this command if you are creating project through composer):
|
||||
> Run this command, in case installing from the zip else skip this command (no need to run this command if you are creating project through composer):
|
||||
~~~
|
||||
composer install
|
||||
~~~
|
||||
|
||||
>> Continue run these command below:
|
||||
> Continue run these command below:
|
||||
~~~
|
||||
php artisan migrate
|
||||
~~~
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ return [
|
|||
/**
|
||||
* Default Select Value
|
||||
*/
|
||||
'select' => 'id',
|
||||
'default_index' => 'id',
|
||||
|
||||
/**
|
||||
* Default OrderBy
|
||||
|
|
@ -30,7 +30,7 @@ return [
|
|||
*
|
||||
* Accepted Value = integer
|
||||
*/
|
||||
'pagination' => 10,
|
||||
'paginate' => true,
|
||||
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* AttributeDataGrid class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
|
|
@ -15,10 +15,8 @@ class AttributeDataGrid extends DataGrid
|
|||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
protected $itemsPerPage = 5; //overriding the default items per page
|
||||
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
|
|
@ -36,7 +34,7 @@ class AttributeDataGrid extends DataGrid
|
|||
{
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'alias' => 'attributeId',
|
||||
// 'alias' => 'attributeId',
|
||||
'label' => 'ID',
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
|
|
@ -46,7 +44,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'code',
|
||||
'alias' => 'attributeCode',
|
||||
// 'alias' => 'attributeCode',
|
||||
'label' => 'Code',
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
|
|
@ -56,7 +54,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'admin_name',
|
||||
'alias' => 'attributeAdminName',
|
||||
// 'alias' => 'attributeAdminName',
|
||||
'label' => 'Name',
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
|
|
@ -66,7 +64,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'type',
|
||||
'alias' => 'attributeType',
|
||||
// 'alias' => 'attributeType',
|
||||
'label' => 'Type',
|
||||
'type' => 'string',
|
||||
'sortable' => true,
|
||||
|
|
@ -76,7 +74,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'is_required',
|
||||
'alias' => 'attributeRequired',
|
||||
// 'alias' => 'attributeRequired',
|
||||
'label' => 'Required',
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
|
|
@ -92,7 +90,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'is_unique',
|
||||
'alias' => 'attributeIsUnique',
|
||||
// 'alias' => 'attributeIsUnique',
|
||||
'label' => 'Unique',
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
|
|
@ -108,7 +106,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'value_per_locale',
|
||||
'alias' => 'attributeValuePerLocale',
|
||||
// 'alias' => 'attributeValuePerLocale',
|
||||
'label' => 'Locale Based',
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
|
|
@ -124,7 +122,7 @@ class AttributeDataGrid extends DataGrid
|
|||
|
||||
$this->addColumn([
|
||||
'index' => 'value_per_channel',
|
||||
'alias' => 'attributeValuePerChannel',
|
||||
// 'alias' => 'attributeValuePerChannel',
|
||||
'label' => 'Channel Based',
|
||||
'type' => 'boolean',
|
||||
'sortable' => true,
|
||||
|
|
|
|||
|
|
@ -6,18 +6,14 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* AttributeFamilyDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class AttributeFamilyDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
protected $itemsPerPage = 5;
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* CategoryDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CategoryDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('categories as cat')->select('cat.id', 'ct.name', 'cat.position', 'cat.status', 'ct.locale')->leftJoin('category_translations as ct', 'cat.id', '=', 'ct.category_id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Channel Data Grid class
|
||||
* ChannelDataGrid class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class ChannelDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('channels')->addSelect('id', 'code', 'name', 'hostname');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Currency Data Grid class
|
||||
* CurrencyDataGrid class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CurrencyDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('currencies')->addSelect('id', 'name', 'code');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Currency Data Grid class
|
||||
* CustomerDataGrid class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CustomerDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('customers as cus')->addSelect('cus.id', 'cus.first_name', 'cus.email', 'cg.name')->leftJoin('customer_groups as cg', 'cus.customer_group_id', '=', 'cg.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Currency Data Grid class
|
||||
* CustomerDataGrid class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CustomerGroupDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('customer_groups')->addSelect('id', 'name');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Currency Data Grid class
|
||||
* CustomerReviewDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CustomerReviewDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('product_reviews as pr')->addSelect('pr.id', 'pr.title', 'pr.comment', 'pg.name', 'pr.status')->leftjoin('products_grid as pg', 'pr.product_id', '=', 'pg.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* ExchangeRateDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class ExchangeRatesDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('currency_exchange_rates as cer')->addSelect('cer.id', 'curr.name', 'cer.rate')->leftJoin('currencies as curr', 'cer.target_currency', '=', 'curr.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* InventorySourcesDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class InventorySourcesDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('inventory_sources')->addSelect('id', 'code', 'name', 'priority', 'status');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* LocalesDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class LocalesDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('locales')->addSelect('id', 'code', 'name');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* News Letter Grid class
|
||||
* NewsLetterDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class NewsLetterDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('subscribers_list')->addSelect('id', 'is_subscribed', 'email');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* OrderDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class OrderDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('orders')->select('id', 'base_grand_total', 'grand_total', 'created_at', 'channel_name', 'status')->addSelect(DB::raw('CONCAT(customer_first_name, " ", customer_last_name) as fullname'));
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* OrderInvoicesDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class OrderInvoicesDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('invoices')->select('id', 'order_id', 'state', 'grand_total', 'created_at');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* OrderShipmentsDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class OrderShipmentsDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('shipments as ship')->select('ship.id', 'ship.order_id', 'ship.total_qty', 'is.name', 'ors.created_at as orderdate', 'ship.created_at')->addSelect(DB::raw('CONCAT(ors.customer_first_name, " ", ors.customer_last_name) as custname'))->leftJoin('orders as ors', 'ship.order_id', '=', 'ors.id')->leftJoin('inventory_sources as is', 'ship.inventory_source_id', '=', 'is.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* ProductDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class ProductDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('products_grid')->addSelect('products_grid.product_id', 'products_grid.sku', 'products_grid.name', 'products.type', 'products_grid.status', 'products_grid.price', 'products_grid.quantity')->leftJoin('products', 'products_grid.product_id', '=', 'products.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* News Letter Grid class
|
||||
* RolesDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class RolesDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('roles')->addSelect('id', 'name', 'permission_type');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* News Letter Grid class
|
||||
* SliderDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class SliderDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('sliders as sl')->addSelect('sl.id', 'sl.title', 'ch.name')->leftJoin('channels as ch', 'sl.channel_id', '=', 'ch.id');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Tax Category Grid class
|
||||
* TaxCategoryDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class TaxCategoryDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('tax_categories')->addSelect('id', 'name', 'code');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* Tax Rate Grid class
|
||||
* TaxRateDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class TaxRateDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('tax_rates')->addSelect('id', 'identifier', 'state', 'country', 'tax_rate');
|
||||
|
|
|
|||
|
|
@ -6,19 +6,13 @@ use Webkul\Ui\DataGrid\DataGrid;
|
|||
use DB;
|
||||
|
||||
/**
|
||||
* News Letter Grid class
|
||||
* UserDataGrid Class
|
||||
*
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class UserDataGrid extends DataGrid
|
||||
{
|
||||
public $allColumns = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->itemsPerPage = 10;
|
||||
}
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('admins as u')->addSelect('u.id', 'u.name', 'u.status', 'u.email', 'ro.name')->leftJoin('roles as ro', 'u.role_id', '=', 'ro.id');
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ class CustomerController extends Controller
|
|||
'first_name' => 'string|required',
|
||||
'last_name' => 'string|required',
|
||||
'gender' => 'required',
|
||||
'phone' => 'nullable|numeric|unique:customers,phone',
|
||||
'email' => 'required|unique:customers,email',
|
||||
'date_of_birth' => 'date|before:today'
|
||||
]);
|
||||
|
|
@ -112,7 +111,9 @@ class CustomerController extends Controller
|
|||
|
||||
$password = bcrypt(rand(100000,10000000));
|
||||
|
||||
$data['password']=$password;
|
||||
$data['password'] = $password;
|
||||
|
||||
$data['is_verified'] = 1;
|
||||
|
||||
$this->customer->create($data);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class RegistrationController extends Controller
|
|||
|
||||
$data['channel_id'] = core()->getCurrentChannel()->id;
|
||||
|
||||
$data['is_verified'] = 0;
|
||||
$data['is_verified'] = 1;
|
||||
|
||||
$data['customer_group_id'] = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Customer extends Authenticatable
|
|||
|
||||
protected $table = 'customers';
|
||||
|
||||
protected $fillable = ['first_name', 'channel_id', 'last_name', 'gender', 'date_of_birth', 'email', 'password', 'customer_group_id', 'subscribed_to_news_letter', 'is_verified', 'token', 'phone'];
|
||||
protected $fillable = ['first_name', 'channel_id', 'last_name', 'gender', 'date_of_birth', 'email', 'password', 'customer_group_id', 'subscribed_to_news_letter', 'is_verified', 'token'];
|
||||
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ class ProductController extends Controller
|
|||
*/
|
||||
public function massDestroy()
|
||||
{
|
||||
dd(request()->input());
|
||||
$productIds = explode(',', request()->input('indexes'));
|
||||
|
||||
foreach ($productIds as $productId) {
|
||||
|
|
@ -222,7 +221,6 @@ class ProductController extends Controller
|
|||
*/
|
||||
public function massUpdate()
|
||||
{
|
||||
dd(request()->input());
|
||||
$data = request()->all();
|
||||
|
||||
if (!isset($data['massaction-type'])) {
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@ namespace Webkul\Ui\DataGrid;
|
|||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Product Data Grid class
|
||||
* DataGrid class
|
||||
*
|
||||
* @author Jitendra Singh <jitendra@webkul.com>
|
||||
* @author Prashant Singh <jitendra@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
abstract class DataGrid
|
||||
{
|
||||
protected $index = null;
|
||||
protected $columns = [];
|
||||
protected $allColumns = [];
|
||||
protected $completeColumnDetails = [];
|
||||
protected $queryBuilder = [];
|
||||
protected $collection = [];
|
||||
protected $actions = [];
|
||||
|
|
@ -22,10 +22,9 @@ abstract class DataGrid
|
|||
protected $request;
|
||||
protected $parse;
|
||||
protected $enableMassAction = false;
|
||||
protected $itemsPerPage = 0;
|
||||
protected $enableAction = false;
|
||||
protected $itemsPerPage = 10;
|
||||
|
||||
abstract public function prepareMassActions();
|
||||
abstract public function prepareActions();
|
||||
abstract public function prepareQueryBuilder();
|
||||
abstract public function addColumns();
|
||||
abstract public function setIndex();
|
||||
|
|
@ -52,12 +51,12 @@ abstract class DataGrid
|
|||
{
|
||||
array_push($this->columns, $column);
|
||||
|
||||
$this->setAllColumnDetails($column);
|
||||
$this->setCompleteColumnDetails($column);
|
||||
}
|
||||
|
||||
public function setAllColumnDetails($column)
|
||||
public function setCompleteColumnDetails($column)
|
||||
{
|
||||
array_push($this->allColumns, $column);
|
||||
array_push($this->completeColumnDetails, $column);
|
||||
}
|
||||
|
||||
public function setQueryBuilder($queryBuilder)
|
||||
|
|
@ -68,6 +67,8 @@ abstract class DataGrid
|
|||
public function addAction($action)
|
||||
{
|
||||
array_push($this->actions, $action);
|
||||
|
||||
$this->enableAction = true;
|
||||
}
|
||||
|
||||
public function addMassAction($massAction)
|
||||
|
|
@ -84,15 +85,18 @@ abstract class DataGrid
|
|||
if(count($parsedUrl)) {
|
||||
$filteredOrSortedCollection = $this->sortOrFilterCollection($this->collection = $this->queryBuilder, $parsedUrl);
|
||||
|
||||
if($this->itemsPerPage > 0) {
|
||||
return $filteredOrSortedCollection->paginate($this->itemsPerPage)->appends(request()->except('page'));
|
||||
if(config('datagrid.paginate')) {
|
||||
if($this->itemsPerPage > 0)
|
||||
return $filteredOrSortedCollection->paginate($this->itemsPerPage)->appends(request()->except('page'));
|
||||
} else {
|
||||
return $filteredOrSortedCollection->get();
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->itemsPerPage > 0) {
|
||||
$this->collection = $this->queryBuilder->paginate($this->itemsPerPage)->appends(request()->except('page'));
|
||||
if(config('datagrid.paginate')) {
|
||||
if ($this->itemsPerPage > 0) {
|
||||
$this->collection = $this->queryBuilder->paginate($this->itemsPerPage)->appends(request()->except('page'));
|
||||
}
|
||||
} else {
|
||||
$this->collection = $this->queryBuilder->get();
|
||||
}
|
||||
|
|
@ -107,8 +111,8 @@ abstract class DataGrid
|
|||
*/
|
||||
public function findColumnType($columnAlias)
|
||||
{
|
||||
foreach($this->allColumns as $column) {
|
||||
if($column['alias'] == $columnAlias) {
|
||||
foreach($this->completeColumnDetails as $column) {
|
||||
if($column['index'] == $columnAlias) {
|
||||
return [$column['type'], $column['index']];
|
||||
}
|
||||
}
|
||||
|
|
@ -142,7 +146,7 @@ abstract class DataGrid
|
|||
|
||||
if($count_keys == 1) {
|
||||
return $collection->where(function() use($collection, $info) {
|
||||
foreach ($this->allColumns as $column) {
|
||||
foreach ($this->completeColumnDetails as $column) {
|
||||
if($column['searchable'] == true)
|
||||
$collection->orWhere($column['index'], 'like', '%'.$info['all'].'%');
|
||||
}
|
||||
|
|
@ -190,6 +194,6 @@ abstract class DataGrid
|
|||
|
||||
$this->prepareQueryBuilder();
|
||||
|
||||
return view('ui::datagrid.table')->with('results', ['records' => $this->getCollection(), 'columns' => $this->allColumns, 'actions' => $this->actions, 'massactions' => $this->massActions, 'index' => $this->index, 'enableMassActions' => $this->enableMassAction, 'norecords' => trans('ui::datagrid.no-records')]);
|
||||
return view('ui::datagrid.table')->with('results', ['records' => $this->getCollection(), 'columns' => $this->completeColumnDetails, 'actions' => $this->actions, 'massactions' => $this->massActions, 'index' => $this->index, 'enableMassActions' => $this->enableMassAction, 'enableActions' => $this->enableAction, 'norecords' => trans('ui::datagrid.no-records')]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<tbody>
|
||||
@foreach($records as $key => $record)
|
||||
<tr>
|
||||
@if($enableMassAction)
|
||||
@if($enableMassActions)
|
||||
<td>
|
||||
<span class="checkbox">
|
||||
<input type="checkbox" v-model="dataIds" @change="select" value="{{ $record->{$index} }}">
|
||||
|
|
@ -29,15 +29,17 @@
|
|||
@endif
|
||||
@endforeach
|
||||
|
||||
<td style="width: 50px;">
|
||||
<div class="actions">
|
||||
@foreach($actions as $action)
|
||||
<a href="{{ route($action['route'], $record->{$index}) }}">
|
||||
<span class="{{ $action['icon'] }}"></span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</td>
|
||||
@if($enableActions)
|
||||
<td style="width: 50px;">
|
||||
<div class="actions">
|
||||
@foreach($actions as $action)
|
||||
<a href="{{ route($action['route'], $record->{$index}) }}">
|
||||
<span class="{{ $action['icon'] }}"></span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="table">
|
||||
<testgrid-filters></testgrid-filters>
|
||||
|
||||
@if(config('datagrid.pagination'))
|
||||
@if(config('datagrid.paginate'))
|
||||
@include('ui::datagrid.pagination', ['results' => $results['records']])
|
||||
@endif
|
||||
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
<select class="filter-column-select control" v-model="filterColumn" v-on:click="getColumnOrAlias(filterColumn)">
|
||||
<option selected disabled>Select Column</option>
|
||||
@foreach($results['columns'] as $column)
|
||||
<option value="{{ $column['alias'] }}">
|
||||
<option value="{{ $column['index'] }}">
|
||||
{{ $column['label'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
|
|
@ -135,7 +135,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="filter-row-two">
|
||||
<span class="filter-tag" v-if="filters.length > 0" v-for="filter in filters">
|
||||
<span class="filter-tag" v-if="filters.length > 0" v-for="filter in filters" style="text-transform: uppercase;">
|
||||
<span v-if="filter.column == 'sort'">@{{ filter.label }}</span>
|
||||
<span v-else-if="filter.column == 'search'">Search</span>
|
||||
<span v-else>@{{ filter.label }}</span>
|
||||
|
|
@ -164,18 +164,19 @@
|
|||
<input type="hidden" id="indexes" name="indexes" v-model="dataIds">
|
||||
|
||||
<div class="control-group">
|
||||
<select class="control" v-model="massActionType" @change="changeMassActionTarget" name="massaction-type">
|
||||
<select class="control" v-model="massActionType" @change="changeMassActionTarget" name="massaction-type" style="text-transform: uppercase;" required>
|
||||
<option v-for="(massAction, index) in massActions" :key="index">@{{ massAction.type }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group" style="margin-left: 10px;" v-if="massActionType == 'update'">
|
||||
<select class="control" v-model="massActionUpdateValue" name="update-options">
|
||||
<select class="control" v-model="massActionUpdateValue" name="update-options" required style="text-transform: uppercase;">
|
||||
<option v-for="(massActionValue, id) in massActionValues" :value="massActionValue">@{{ id }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-sm btn-primary" style="margin-left: 10px;">
|
||||
<input type="submit" class="btn btn-sm btn-primary" style="margin-left: 10px; margin-top: 3px;
|
||||
height: 30px;">
|
||||
</form>
|
||||
</div>
|
||||
</th>
|
||||
|
|
@ -196,18 +197,20 @@
|
|||
@endif
|
||||
|
||||
@foreach($results['columns'] as $key => $column)
|
||||
<th class="grid_head" style="width: {{ $column['width'] }}" v-on:click="sortCollection('{{ $column['alias'] }}')">
|
||||
<th class="grid_head" style="width: {{ $column['width'] }}" v-on:click="sortCollection('{{ $column['index'] }}')">
|
||||
{{ $column['label'] }}
|
||||
</th>
|
||||
@endforeach
|
||||
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
@if($results['enableActions'])
|
||||
<th>
|
||||
Actions
|
||||
</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@include('ui::datagrid.body', ['records' => $results['records'], 'actions' => $results['actions'], 'index' => $results['index'], 'columns' => $results['columns'],'enableMassAction' => $results['enableMassActions']])
|
||||
@include('ui::datagrid.body', ['records' => $results['records'], 'actions' => $results['actions'], 'index' => $results['index'], 'columns' => $results['columns'],'enableMassActions' => $results['enableMassActions'], 'enableActions' => $results['enableActions']])
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
|
|
@ -265,7 +268,7 @@
|
|||
this.columnOrAlias = columnOrAlias;
|
||||
|
||||
for(column in this.columns) {
|
||||
if (this.columns[column].alias == this.columnOrAlias) {
|
||||
if (this.columns[column].index == this.columnOrAlias) {
|
||||
this.type = this.columns[column].type;
|
||||
|
||||
if(this.type == 'string') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue