Merge pull request #1437 from prashant-webkul/development
Datagrid add column, action and mass action dynamic event fire. Command line utility for installation.
This commit is contained in:
commit
fe335a0e70
|
|
@ -3,7 +3,7 @@ APP_ENV=local
|
||||||
APP_VERSION=0.1.6
|
APP_VERSION=0.1.6
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://yourdomain.com
|
APP_URL=http://localhost
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,179 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class BagistoInstall extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'bagisto:install';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'This command will try to configure and install new Bagisto instance';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$path = base_path('.env');
|
||||||
|
|
||||||
|
$uname = strtolower(\php_uname());
|
||||||
|
|
||||||
|
if (str_contains($uname, 'win'))
|
||||||
|
shell_exec('copy .env.example .env');
|
||||||
|
else
|
||||||
|
shell_exec('cp .env.example .env');
|
||||||
|
|
||||||
|
$this->line('Hello and welcome to Bagisto command line installer.');
|
||||||
|
|
||||||
|
$APP_NAME = $this->ask('[KEY = "APP_NAME"] Please enter name of application instance?');
|
||||||
|
$this->comment($APP_NAME ?? 'Bagisto');
|
||||||
|
$this->changeEnvironmentVariable('APP_NAME', $APP_NAME);
|
||||||
|
|
||||||
|
$APP_ENV = $this->choice('[KEY = "APP_ENV"] Choose environment for this instance of Bagisto?', ['development', 'production'], 0);
|
||||||
|
$this->comment($APP_ENV);
|
||||||
|
$this->changeEnvironmentVariable('APP_ENV', $APP_ENV);
|
||||||
|
|
||||||
|
// $APP_DEBUG = $this->ask('Choose APP_DEBUG?', ['true', 'false'], 0);
|
||||||
|
// $this->comment($APP_DEBUG);
|
||||||
|
// $this->changeEnvironmentVariable('APP_DEBUG', $APP_DEBUG);
|
||||||
|
|
||||||
|
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
||||||
|
$this->comment($APP_URL ?? 'localhost');
|
||||||
|
$this->changeEnvironmentVariable('APP_URL', $APP_URL);
|
||||||
|
|
||||||
|
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
||||||
|
$this->comment($DB_CONNECTION ?? 'mysql');
|
||||||
|
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION);
|
||||||
|
|
||||||
|
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
||||||
|
$this->comment($DB_HOST ?? '127.0.0.1');
|
||||||
|
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST);
|
||||||
|
|
||||||
|
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
||||||
|
$this->comment($DB_PORT ?? '3306');
|
||||||
|
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT);
|
||||||
|
|
||||||
|
$DB_DATABASE = null;
|
||||||
|
|
||||||
|
while(! isset($DB_DATABASE)) {
|
||||||
|
$DB_DATABASE = $this->ask('[KEY = "DB_DATABASE"] Enter name of database?');
|
||||||
|
$this->comment($DB_DATABASE ?? 'forge');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE);
|
||||||
|
|
||||||
|
while(! isset($DB_USERNAME)) {
|
||||||
|
$DB_USERNAME = $this->ask('Enter database username?');
|
||||||
|
$this->comment($DB_USERNAME ?? 'root');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->changeEnvironmentVariable('[KEY = "DB_USERNAME"] DB_USERNAME', $DB_USERNAME);
|
||||||
|
|
||||||
|
$DB_PASSWORD = $this->ask('Please enter database password?');
|
||||||
|
$this->comment($DB_PASSWORD);
|
||||||
|
$this->changeEnvironmentVariable('[KEY = "DB_PASSWORD"] DB_PASSWORD', $DB_PASSWORD);
|
||||||
|
|
||||||
|
$this->info('We are done with application and database params, good job!');
|
||||||
|
|
||||||
|
$this->info('Do you want me to be mail ready, i am loaded with notifications!');
|
||||||
|
|
||||||
|
$MAIL_DRIVER = $this->ask('[KEY = "MAIL_DRIVER"] Enter MAIL_DRIVER (Optional, default = smtp)?');
|
||||||
|
$this->comment($MAIL_DRIVER ?? 'smtp');
|
||||||
|
$this->changeEnvironmentVariable('MAIL_DRIVER', $MAIL_DRIVER ?? 'smtp');
|
||||||
|
|
||||||
|
$MAIL_HOST = $this->ask('[KEY = "MAIL_HOST"] Enter MAIL_HOST (Optional, default = smtp.mailtrap.io)?');
|
||||||
|
$this->comment($MAIL_HOST ?? 'smtp.mailtrap.io');
|
||||||
|
$this->changeEnvironmentVariable('MAIL_HOST', $MAIL_HOST ?? 'smtp.mailtrap.io');
|
||||||
|
|
||||||
|
$MAIL_PORT = $this->ask('[KEY = "MAIL_PORT"] Enter MAIL_PORT (Optional, default = 2525)?');
|
||||||
|
$this->comment($MAIL_PORT ?? '2525');
|
||||||
|
$this->changeEnvironmentVariable('MAIL_PORT', $MAIL_PORT ?? '2525');
|
||||||
|
|
||||||
|
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
||||||
|
$this->comment($MAIL_USERNAME ?? null);
|
||||||
|
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME);
|
||||||
|
|
||||||
|
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
||||||
|
$this->comment($MAIL_PASSWORD ?? null);
|
||||||
|
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD);
|
||||||
|
|
||||||
|
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
||||||
|
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
||||||
|
$this->changeEnvironmentVariable('MAIL_ENCRYPTION', $MAIL_ENCRYPTION ?? 'tls');
|
||||||
|
|
||||||
|
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
||||||
|
$this->comment($SHOP_MAIL_FROM ?? null);
|
||||||
|
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM);
|
||||||
|
|
||||||
|
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
||||||
|
$this->comment($ADMIN_MAIL_TO ?? null);
|
||||||
|
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO);
|
||||||
|
|
||||||
|
$this->info('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
||||||
|
|
||||||
|
\Artisan::call('config:cache');
|
||||||
|
|
||||||
|
$this->info('Running migrations...');
|
||||||
|
|
||||||
|
\Artisan::call('migrate');
|
||||||
|
|
||||||
|
$this->info('Migration completed.');
|
||||||
|
|
||||||
|
$this->info('Running seeders...');
|
||||||
|
|
||||||
|
\Artisan::call('db:seed', ['--force' => true]);
|
||||||
|
|
||||||
|
$this->info('Seeders finished.');
|
||||||
|
|
||||||
|
\Artisan::call('storage:link');
|
||||||
|
|
||||||
|
$this->info('Storage link created...');
|
||||||
|
|
||||||
|
\Artisan::call('vendor:publish', [0]);
|
||||||
|
|
||||||
|
$this->info('All provider tags are published...');
|
||||||
|
|
||||||
|
$this->info('Installation completed.');
|
||||||
|
|
||||||
|
$this->info('Please write us: SUPPORT@BAGISTO.COM');
|
||||||
|
|
||||||
|
$this->info('Thank you!!!');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function changeEnvironmentVariable($key, $value)
|
||||||
|
{
|
||||||
|
$path = base_path('.env');
|
||||||
|
|
||||||
|
if (file_exists($path)) {
|
||||||
|
|
||||||
|
file_put_contents($path, str_replace(
|
||||||
|
$key . '=' . env($key),
|
||||||
|
$key . '=' . $value,
|
||||||
|
file_get_contents($path)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Webkul\Product\Repositories\ProductRepository as Product;
|
||||||
|
|
||||||
|
class GenerateProducts extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'bagisto:generate {value}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Generates product with random attribute values.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProductRepository instance
|
||||||
|
*/
|
||||||
|
protected $product;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(Product $product)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->product = $product;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
if ($this->argument('value') == 'products') {
|
||||||
|
$this->comment('Under development.');
|
||||||
|
} else {
|
||||||
|
$this->line('Sorry, generate option is either invalid or does not exist.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,8 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -48,7 +50,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'admin_name',
|
'index' => 'admin_name',
|
||||||
'label' => trans('admin::app.datagrid.admin-name'),
|
'label' => trans('admin::app.name'),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -57,7 +59,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'type',
|
'index' => 'type',
|
||||||
'label' => trans('admin::app.datagrid.type'),
|
'label' => trans('admin::app.type'),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
|
|
@ -66,7 +68,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'is_required',
|
'index' => 'is_required',
|
||||||
'label' => trans('admin::app.datagrid.required'),
|
'label' => trans('admin::app.required'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
@ -80,7 +82,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'is_unique',
|
'index' => 'is_unique',
|
||||||
'label' => trans('admin::app.datagrid.unique'),
|
'label' => trans('admin::app.unique'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
@ -95,7 +97,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'value_per_locale',
|
'index' => 'value_per_locale',
|
||||||
'label' => trans('admin::app.datagrid.per-locale'),
|
'label' => trans('admin::app.locale-based'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
@ -110,7 +112,7 @@ class AttributeDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'value_per_channel',
|
'index' => 'value_per_channel',
|
||||||
'label' => trans('admin::app.datagrid.per-channel'),
|
'label' => trans('admin::app.channel-based'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
@ -127,15 +129,15 @@ class AttributeDataGrid extends DataGrid
|
||||||
public function prepareActions()
|
public function prepareActions()
|
||||||
{
|
{
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Attribute',
|
||||||
'method' => 'GET', //use post only for redirects only
|
'method' => 'GET', //use get for redirects only
|
||||||
'route' => 'admin.catalog.attributes.edit',
|
'route' => 'admin.catalog.attributes.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Attribute',
|
||||||
'method' => 'POST', //use post only for requests other than redirects
|
'method' => 'POST', // other than get request it fires ajax and self refreshes datagrid
|
||||||
'route' => 'admin.catalog.attributes.delete',
|
'route' => 'admin.catalog.attributes.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,11 @@ class AttributeFamilyDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.id'),
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -37,7 +39,7 @@ class AttributeFamilyDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'code',
|
'index' => 'code',
|
||||||
'label' => trans('admin::app.datagrid.code'),
|
'label' => trans('admin::app.code'),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -46,7 +48,7 @@ class AttributeFamilyDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'name',
|
'index' => 'name',
|
||||||
'label' => trans('admin::app.datagrid.name'),
|
'label' => trans('admin::app.name'),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -56,14 +58,14 @@ class AttributeFamilyDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Attribute Family',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.catalog.families.edit',
|
'route' => 'admin.catalog.families.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Attribute Family',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes and POST for rest
|
'method' => 'POST', // use GET request only for redirect purposes and POST for rest
|
||||||
'route' => 'admin.catalog.families.delete',
|
'route' => 'admin.catalog.families.delete',
|
||||||
// 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
// 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ class CMSPageDataGrid extends DataGrid
|
||||||
|
|
||||||
$locales = app('Webkul\Core\Repositories\LocaleRepository');
|
$locales = app('Webkul\Core\Repositories\LocaleRepository');
|
||||||
|
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -88,14 +90,14 @@ class CMSPageDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit CMSPage',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.cms.edit',
|
'route' => 'admin.cms.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete CMSPage',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.cms.delete',
|
'route' => 'admin.cms.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,11 @@ class CartRuleDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.id'),
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -39,7 +41,7 @@ class CartRuleDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'name',
|
'index' => 'name',
|
||||||
'label' => trans('admin::app.datagrid.name'),
|
'label' => trans('admin::app.name'),
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -48,7 +50,7 @@ class CartRuleDataGrid extends DataGrid
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'status',
|
'index' => 'status',
|
||||||
'label' => trans('admin::app.datagrid.status'),
|
'label' => trans('admin::app.status'),
|
||||||
'type' => 'boolean',
|
'type' => 'boolean',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
|
|
@ -117,14 +119,14 @@ class CartRuleDataGrid extends DataGrid
|
||||||
public function prepareActions()
|
public function prepareActions()
|
||||||
{
|
{
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit CartRule',
|
||||||
'method' => 'GET', //use post only for redirects only
|
'method' => 'GET', //use post only for redirects only
|
||||||
'route' => 'admin.cart-rule.edit',
|
'route' => 'admin.cart-rule.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete CartRule',
|
||||||
'method' => 'POST', //use post only for requests other than redirects
|
'method' => 'POST', //use post only for requests other than redirects
|
||||||
'route' => 'admin.cart-rule.delete',
|
'route' => 'admin.cart-rule.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ class CatalogRuleDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -107,14 +109,14 @@ class CatalogRuleDataGrid extends DataGrid
|
||||||
public function prepareActions()
|
public function prepareActions()
|
||||||
{
|
{
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit CatalogRule',
|
||||||
'method' => 'GET', //use post only for redirects only
|
'method' => 'GET', //use post only for redirects only
|
||||||
'route' => 'admin.catalog-rule.edit',
|
'route' => 'admin.catalog-rule.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete CatalogRule',
|
||||||
'method' => 'POST', //use post only for requests other than redirects
|
'method' => 'POST', //use post only for requests other than redirects
|
||||||
'route' => 'admin.catalog-rule.delete',
|
'route' => 'admin.catalog-rule.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ class CategoryDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'category_id',
|
'index' => 'category_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -91,14 +93,14 @@ class CategoryDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Category',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.catalog.categories.edit',
|
'route' => 'admin.catalog.categories.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Category',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.catalog.categories.delete',
|
'route' => 'admin.catalog.categories.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class ChannelDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -65,14 +67,14 @@ class ChannelDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Channel',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.channels.edit',
|
'route' => 'admin.channels.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Channel',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.channels.delete',
|
'route' => 'admin.channels.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class CurrencyDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -56,14 +58,14 @@ class CurrencyDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Currency',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.currencies.edit',
|
'route' => 'admin.currencies.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Currency',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.currencies.delete',
|
'route' => 'admin.currencies.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ class CustomerDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'customer_id',
|
'index' => 'customer_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -89,7 +91,6 @@ class CustomerDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customer.edit',
|
'route' => 'admin.customer.edit',
|
||||||
'icon' => 'icon pencil-lg-icon',
|
'icon' => 'icon pencil-lg-icon',
|
||||||
|
|
@ -97,7 +98,6 @@ class CustomerDataGrid extends DataGrid
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customer.delete',
|
'route' => 'admin.customer.delete',
|
||||||
'icon' => 'icon trash-icon',
|
'icon' => 'icon trash-icon',
|
||||||
|
|
@ -105,7 +105,6 @@ class CustomerDataGrid extends DataGrid
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Add Note',
|
|
||||||
'method' => 'GET',
|
'method' => 'GET',
|
||||||
'route' => 'admin.customer.note.create',
|
'route' => 'admin.customer.note.create',
|
||||||
'icon' => 'icon note-icon',
|
'icon' => 'icon note-icon',
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class CustomerGroupDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => 'ID',
|
'label' => 'ID',
|
||||||
|
|
@ -56,14 +58,14 @@ class CustomerGroupDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Customer Group',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.groups.edit',
|
'route' => 'admin.groups.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Customer Group',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.groups.delete',
|
'route' => 'admin.groups.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ class CustomerReviewDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'product_review_id',
|
'index' => 'product_review_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -92,14 +94,14 @@ class CustomerReviewDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Customer Review',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customer.review.edit',
|
'route' => 'admin.customer.review.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Customer Review',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customer.review.delete',
|
'route' => 'admin.customer.review.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ class ExchangeRatesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'currency_exch_id',
|
'index' => 'currency_exch_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -58,14 +60,14 @@ class ExchangeRatesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Exchange Rate',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.exchange_rates.edit',
|
'route' => 'admin.exchange_rates.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Exchange Rate',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.exchange_rates.delete',
|
'route' => 'admin.exchange_rates.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class InventorySourcesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -80,14 +82,14 @@ class InventorySourcesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Inventory Source',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.inventory_sources.edit',
|
'route' => 'admin.inventory_sources.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Inventory Source',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.inventory_sources.delete',
|
'route' => 'admin.inventory_sources.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class LocalesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -65,14 +67,14 @@ class LocalesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Locales',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.locales.edit',
|
'route' => 'admin.locales.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Locales',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.locales.delete',
|
'route' => 'admin.locales.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class NewsLetterDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -62,14 +64,14 @@ class NewsLetterDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit News Letter',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customers.subscribers.edit',
|
'route' => 'admin.customers.subscribers.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete News Letter',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.customers.subscribers.delete',
|
'route' => 'admin.customers.subscribers.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']),
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class OrderDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -134,7 +136,7 @@ class OrderDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'View',
|
'title' => 'Order View',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.sales.orders.view',
|
'route' => 'admin.sales.orders.view',
|
||||||
'icon' => 'icon eye-icon'
|
'icon' => 'icon eye-icon'
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class OrderInvoicesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -65,7 +67,7 @@ class OrderInvoicesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'View',
|
'title' => 'Order Invoice View',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.sales.invoices.view',
|
'route' => 'admin.sales.invoices.view',
|
||||||
'icon' => 'icon eye-icon'
|
'icon' => 'icon eye-icon'
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class OrderShipmentsDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'shipment_id',
|
'index' => 'shipment_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -108,7 +110,7 @@ class OrderShipmentsDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'View',
|
'title' => 'Order Shipment View',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.sales.shipments.view',
|
'route' => 'admin.sales.shipments.view',
|
||||||
'icon' => 'icon eye-icon'
|
'icon' => 'icon eye-icon'
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ class ProductDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'product_id',
|
'index' => 'product_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -129,14 +131,14 @@ class ProductDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Product',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.catalog.products.edit',
|
'route' => 'admin.catalog.products.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Product',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.catalog.products.delete',
|
'route' => 'admin.catalog.products.delete',
|
||||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']),
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class RolesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -57,14 +59,14 @@ class RolesDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.roles.edit',
|
'route' => 'admin.roles.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.roles.delete',
|
'route' => 'admin.roles.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ class SliderDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'slider_id',
|
'index' => 'slider_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -60,14 +62,14 @@ class SliderDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Slider',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.sliders.edit',
|
'route' => 'admin.sliders.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Slider',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.sliders.delete',
|
'route' => 'admin.sliders.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class TaxCategoryDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -56,14 +58,14 @@ class TaxCategoryDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Tax Category',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.tax-categories.edit',
|
'route' => 'admin.tax-categories.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Tax Category',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.tax-categories.delete',
|
'route' => 'admin.tax-categories.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ class TaxRateDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'id',
|
'index' => 'id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -101,14 +103,14 @@ class TaxRateDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit Tax Rate',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.tax-rates.store',
|
'route' => 'admin.tax-rates.store',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete Tax Rate',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.tax-rates.delete',
|
'route' => 'admin.tax-rates.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ class UserDataGrid extends DataGrid
|
||||||
|
|
||||||
public function addColumns()
|
public function addColumns()
|
||||||
{
|
{
|
||||||
|
$this->setInvoker($this);
|
||||||
|
|
||||||
$this->addColumn([
|
$this->addColumn([
|
||||||
'index' => 'user_id',
|
'index' => 'user_id',
|
||||||
'label' => trans('admin::app.datagrid.id'),
|
'label' => trans('admin::app.datagrid.id'),
|
||||||
|
|
@ -85,14 +87,14 @@ class UserDataGrid extends DataGrid
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Edit',
|
'title' => 'Edit User',
|
||||||
'method' => 'GET', // use GET request only for redirect purposes
|
'method' => 'GET', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.users.edit',
|
'route' => 'admin.users.edit',
|
||||||
'icon' => 'icon pencil-lg-icon'
|
'icon' => 'icon pencil-lg-icon'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->addAction([
|
$this->addAction([
|
||||||
'type' => 'Delete',
|
'title' => 'Delete User',
|
||||||
'method' => 'POST', // use GET request only for redirect purposes
|
'method' => 'POST', // use GET request only for redirect purposes
|
||||||
'route' => 'admin.users.delete',
|
'route' => 'admin.users.delete',
|
||||||
'icon' => 'icon trash-icon'
|
'icon' => 'icon trash-icon'
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ return [
|
||||||
'no result' => 'No result',
|
'no result' => 'No result',
|
||||||
'product' => 'Product',
|
'product' => 'Product',
|
||||||
'attribute' => 'Attribute',
|
'attribute' => 'Attribute',
|
||||||
|
'actions' => 'Actions',
|
||||||
|
'id' => 'ID',
|
||||||
|
'action' => 'action',
|
||||||
'yes' => 'Yes',
|
'yes' => 'Yes',
|
||||||
'no' => 'No',
|
'no' => 'No',
|
||||||
'true' => 'True',
|
'true' => 'True',
|
||||||
|
|
@ -18,6 +21,16 @@ return [
|
||||||
'apply' => 'Apply',
|
'apply' => 'Apply',
|
||||||
'action' => 'Action',
|
'action' => 'Action',
|
||||||
'label' => 'Label',
|
'label' => 'Label',
|
||||||
|
'name' => 'Name',
|
||||||
|
'title' => 'Title',
|
||||||
|
'code' => 'Code',
|
||||||
|
'type' => 'Type',
|
||||||
|
'required' => 'Required',
|
||||||
|
'unique' => 'Unique',
|
||||||
|
'locale-based' => 'Locale based',
|
||||||
|
'channel-based' => 'Channel based',
|
||||||
|
'status' => 'Status',
|
||||||
|
'select-option' => 'Select option',
|
||||||
|
|
||||||
'common' => [
|
'common' => [
|
||||||
'no-result-found' => 'We could not find any records.',
|
'no-result-found' => 'We could not find any records.',
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@
|
||||||
<!-- Cart Attributes -->
|
<!-- Cart Attributes -->
|
||||||
<div class="control-container mt-20" v-for="(condition, index) in conditions_list" :key="index">
|
<div class="control-container mt-20" v-for="(condition, index) in conditions_list" :key="index">
|
||||||
<select class="control" name="cart_attributes[]" v-model="conditions_list[index].attribute" title="You Can Make Multiple Selections Here" style="margin-right: 15px; width: 30%;" v-on:change="enableCondition($event, index)">
|
<select class="control" name="cart_attributes[]" v-model="conditions_list[index].attribute" title="You Can Make Multiple Selections Here" style="margin-right: 15px; width: 30%;" v-on:change="enableCondition($event, index)">
|
||||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'Option']) }}</option>
|
<option disabled="disabled">{{ __('admin::app.select-option') }}</option>
|
||||||
<option v-for="(cart_ip, index1) in cart_input" :value="cart_ip.code" :key="index1">@{{ cart_ip.name }}</option>
|
<option v-for="(cart_ip, index1) in cart_input" :value="cart_ip.code" :key="index1">@{{ cart_ip.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
|
|
||||||
<div v-if='conditions_list[index].attribute == "shipping_state"'>
|
<div v-if='conditions_list[index].attribute == "shipping_state"'>
|
||||||
<select class="control" v-model="conditions_list[index].value">
|
<select class="control" v-model="conditions_list[index].value">
|
||||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'State']) }}</option>
|
<option disabled="disabled">{{ __('admin::app.select-option') }}</option>
|
||||||
<optgroup v-for='(state, code) in country_and_states.states' :label="code">
|
<optgroup v-for='(state, code) in country_and_states.states' :label="code">
|
||||||
<option v-for="(stateObj, index) in state" :value="stateObj.code">@{{ stateObj.default_name }}</option>
|
<option v-for="(stateObj, index) in state" :value="stateObj.code">@{{ stateObj.default_name }}</option>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
|
|
@ -208,7 +208,7 @@
|
||||||
|
|
||||||
<div v-if='conditions_list[index].attribute == "shipping_country"'>
|
<div v-if='conditions_list[index].attribute == "shipping_country"'>
|
||||||
<select class="control" v-model="conditions_list[index].value">
|
<select class="control" v-model="conditions_list[index].value">
|
||||||
<option disabled="disabled">{{ __('admin::app.promotion.select-attribtue', ['attrbibute' => 'Country']) }}</option>
|
<option disabled="disabled">{{ __('admin::app.select-option']) }}</option>
|
||||||
<option v-for="(country, index) in country_and_states.countries" :value="country.code">@{{ country.name }}</option>
|
<option v-for="(country, index) in country_and_states.countries" :value="country.code">@{{ country.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,5 +9,6 @@ class ProductTableSeeder extends Seeder
|
||||||
{
|
{
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
|
dd('running');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Webkul\Ui\DataGrid;
|
namespace Webkul\Ui\DataGrid;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DataGrid class
|
* DataGrid class
|
||||||
|
|
@ -12,22 +12,87 @@ use Illuminate\Http\Request;
|
||||||
*/
|
*/
|
||||||
abstract class DataGrid
|
abstract class DataGrid
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* set index columns, ex: id.
|
||||||
|
*/
|
||||||
protected $index = null;
|
protected $index = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To know the class of datagrid calling parent methods, to be set by the extending class.
|
||||||
|
*/
|
||||||
|
protected $invoker = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default sort order of datagrid
|
||||||
|
*/
|
||||||
protected $sortOrder = 'asc';
|
protected $sortOrder = 'asc';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Situation handling property when working with custom columns in datagrid, helps abstaining
|
||||||
|
* aliases on custom column.
|
||||||
|
*/
|
||||||
protected $enableFilterMap = false;
|
protected $enableFilterMap = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is array where aliases and custom column's name are passed
|
||||||
|
*/
|
||||||
protected $filterMap = [];
|
protected $filterMap = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* array to hold all the columns which will be displayed on frontend.
|
||||||
|
*/
|
||||||
protected $columns = [];
|
protected $columns = [];
|
||||||
|
|
||||||
protected $completeColumnDetails = [];
|
protected $completeColumnDetails = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hold query builder instance of the query prepared by executing datagrid
|
||||||
|
* class method setQueryBuilder
|
||||||
|
*/
|
||||||
protected $queryBuilder = [];
|
protected $queryBuilder = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Final result of the datagrid program that is collection object.
|
||||||
|
*/
|
||||||
protected $collection = [];
|
protected $collection = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of handly click tools which you could be using for various operations.
|
||||||
|
* ex: dyanmic and static redirects, deleting, etc.
|
||||||
|
*/
|
||||||
protected $actions = [];
|
protected $actions = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Works on selection of values index column as comma separated list as response
|
||||||
|
* to your endpoint set as route.
|
||||||
|
*/
|
||||||
protected $massActions = [];
|
protected $massActions = [];
|
||||||
protected $request;
|
|
||||||
|
/**
|
||||||
|
* Parsed value of the url parameters
|
||||||
|
*/
|
||||||
protected $parse;
|
protected $parse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To show mass action or not.
|
||||||
|
*/
|
||||||
protected $enableMassAction = false;
|
protected $enableMassAction = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To enable actions or not.
|
||||||
|
*/
|
||||||
protected $enableAction = false;
|
protected $enableAction = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* paginate the collection or not
|
||||||
|
*/
|
||||||
protected $paginate = true;
|
protected $paginate = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If paginated then value of pagination.
|
||||||
|
*/
|
||||||
protected $itemsPerPage = 15;
|
protected $itemsPerPage = 15;
|
||||||
|
|
||||||
protected $operators = [
|
protected $operators = [
|
||||||
'eq' => "=",
|
'eq' => "=",
|
||||||
'lt' => "<",
|
'lt' => "<",
|
||||||
|
|
@ -105,9 +170,13 @@ abstract class DataGrid
|
||||||
|
|
||||||
public function addColumn($column)
|
public function addColumn($column)
|
||||||
{
|
{
|
||||||
|
$this->fireEvent('add.column.before.'.$column['index']);
|
||||||
|
|
||||||
array_push($this->columns, $column);
|
array_push($this->columns, $column);
|
||||||
|
|
||||||
$this->setCompleteColumnDetails($column);
|
$this->setCompleteColumnDetails($column);
|
||||||
|
|
||||||
|
$this->fireEvent('add.column.after.'.$column['index']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCompleteColumnDetails($column)
|
public function setCompleteColumnDetails($column)
|
||||||
|
|
@ -122,16 +191,40 @@ abstract class DataGrid
|
||||||
|
|
||||||
public function addAction($action)
|
public function addAction($action)
|
||||||
{
|
{
|
||||||
|
if (isset($action['title'])) {
|
||||||
|
$eventName = strtolower($action['title']);
|
||||||
|
$eventName = explode(' ', $eventName);
|
||||||
|
$eventName = implode('.', $eventName);
|
||||||
|
} else {
|
||||||
|
$eventName = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fireEvent('action.before.'.$eventName);
|
||||||
|
|
||||||
array_push($this->actions, $action);
|
array_push($this->actions, $action);
|
||||||
|
|
||||||
$this->enableAction = true;
|
$this->enableAction = true;
|
||||||
|
|
||||||
|
$this->fireEvent('action.after.' . $eventName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addMassAction($massAction)
|
public function addMassAction($massAction)
|
||||||
{
|
{
|
||||||
|
if (isset($massAction['label'])) {
|
||||||
|
$eventName = strtolower($massAction['label']);
|
||||||
|
$eventName = explode(' ', $eventName);
|
||||||
|
$eventName = implode('.', $eventName);
|
||||||
|
} else {
|
||||||
|
$eventName = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fireEvent('mass.action.before.' . $eventName);
|
||||||
|
|
||||||
array_push($this->massActions, $massAction);
|
array_push($this->massActions, $massAction);
|
||||||
|
|
||||||
$this->enableMassAction = true;
|
$this->enableMassAction = true;
|
||||||
|
|
||||||
|
$this->fireEvent('mass.action.after.' . $eventName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCollection()
|
public function getCollection()
|
||||||
|
|
@ -306,12 +399,32 @@ abstract class DataGrid
|
||||||
return $collection;
|
return $collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function fireEvent($name)
|
||||||
|
{
|
||||||
|
if (isset($name)) {
|
||||||
|
$className = get_class($this->invoker);
|
||||||
|
|
||||||
|
$className = last(explode("\\", $className));
|
||||||
|
|
||||||
|
$className = strtolower($className);
|
||||||
|
|
||||||
|
$eventName = $className . '.' . $name;
|
||||||
|
|
||||||
|
Event::fire($eventName, $this->invoker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function prepareMassActions() {
|
public function prepareMassActions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prepareActions() {
|
public function prepareActions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setInvoker($object)
|
||||||
|
{
|
||||||
|
$this->invoker = $object;
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$this->addColumns();
|
$this->addColumns();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
Event::listen('attributedatagrid.before.add.column.id', function($dataGridInstance) {
|
||||||
|
$data = [
|
||||||
|
'index' => 'is_required',
|
||||||
|
'label' => 'trans',
|
||||||
|
'type' => 'boolean',
|
||||||
|
'sortable' => true,
|
||||||
|
'searchable' => false,
|
||||||
|
'wrapper' => function ($value) {
|
||||||
|
if ($value->is_required == 1)
|
||||||
|
return 'True';
|
||||||
|
else
|
||||||
|
return 'False';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
$dataGridInstance->addColumn($data);
|
||||||
|
});
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
@if ($enableActions)
|
@if ($enableActions)
|
||||||
<td class="actions" style="width: 100px;" data-value=" {{ __('ui::app.datagrid.actions') }}">
|
<td class="actions" style="width: 100px;" data-value="{{ __('ui::app.datagrid.actions') }}">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
@foreach ($actions as $action)
|
@foreach ($actions as $action)
|
||||||
<a
|
<a
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue