diff --git a/.env.example b/.env.example index c5a659604..0b75a6079 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ APP_ENV=local APP_VERSION=0.1.6 APP_KEY= APP_DEBUG=true -APP_URL=http://yourdomain.com +APP_URL=http://localhost LOG_CHANNEL=stack diff --git a/app/Console/Commands/BagistoInstall.php b/app/Console/Commands/BagistoInstall.php new file mode 100644 index 000000000..f17a2f2b4 --- /dev/null +++ b/app/Console/Commands/BagistoInstall.php @@ -0,0 +1,179 @@ +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) + )); + } + } +} \ No newline at end of file diff --git a/app/Console/Commands/GenerateProducts.php b/app/Console/Commands/GenerateProducts.php new file mode 100644 index 000000000..332f1af4d --- /dev/null +++ b/app/Console/Commands/GenerateProducts.php @@ -0,0 +1,54 @@ +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.'); + } + } +} diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php index 382944d1c..411c7422a 100755 --- a/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeDataGrid.php @@ -28,6 +28,8 @@ class AttributeDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -48,7 +50,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'admin_name', - 'label' => trans('admin::app.datagrid.admin-name'), + 'label' => trans('admin::app.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -57,7 +59,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'type', - 'label' => trans('admin::app.datagrid.type'), + 'label' => trans('admin::app.type'), 'type' => 'string', 'sortable' => true, 'searchable' => true, @@ -66,7 +68,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'is_required', - 'label' => trans('admin::app.datagrid.required'), + 'label' => trans('admin::app.required'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, @@ -80,7 +82,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'is_unique', - 'label' => trans('admin::app.datagrid.unique'), + 'label' => trans('admin::app.unique'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, @@ -95,7 +97,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'value_per_locale', - 'label' => trans('admin::app.datagrid.per-locale'), + 'label' => trans('admin::app.locale-based'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, @@ -110,7 +112,7 @@ class AttributeDataGrid extends DataGrid $this->addColumn([ 'index' => 'value_per_channel', - 'label' => trans('admin::app.datagrid.per-channel'), + 'label' => trans('admin::app.channel-based'), 'type' => 'boolean', 'sortable' => true, 'searchable' => false, @@ -127,15 +129,15 @@ class AttributeDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', - 'method' => 'GET', //use post only for redirects only + 'title' => 'Edit Attribute', + 'method' => 'GET', //use get for redirects only 'route' => 'admin.catalog.attributes.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', - 'method' => 'POST', //use post only for requests other than redirects + 'title' => 'Delete Attribute', + 'method' => 'POST', // other than get request it fires ajax and self refreshes datagrid 'route' => 'admin.catalog.attributes.delete', 'icon' => 'icon trash-icon' ]); diff --git a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php index 0c631a4ed..d0b1b0c5f 100755 --- a/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AttributeFamilyDataGrid.php @@ -26,9 +26,11 @@ class AttributeFamilyDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', - 'label' => trans('admin::app.datagrid.id'), + 'label' => trans('admin::app.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -37,7 +39,7 @@ class AttributeFamilyDataGrid extends DataGrid $this->addColumn([ 'index' => 'code', - 'label' => trans('admin::app.datagrid.code'), + 'label' => trans('admin::app.code'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -46,7 +48,7 @@ class AttributeFamilyDataGrid extends DataGrid $this->addColumn([ 'index' => 'name', - 'label' => trans('admin::app.datagrid.name'), + 'label' => trans('admin::app.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -56,14 +58,14 @@ class AttributeFamilyDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Attribute Family', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.catalog.families.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Attribute Family', 'method' => 'POST', // use GET request only for redirect purposes and POST for rest 'route' => 'admin.catalog.families.delete', // 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), diff --git a/packages/Webkul/Admin/src/DataGrids/CMSPageDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CMSPageDataGrid.php index ebafd957f..5c5287ce1 100644 --- a/packages/Webkul/Admin/src/DataGrids/CMSPageDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CMSPageDataGrid.php @@ -30,6 +30,8 @@ class CMSPageDataGrid extends DataGrid $locales = app('Webkul\Core\Repositories\LocaleRepository'); + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -88,14 +90,14 @@ class CMSPageDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit CMSPage', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.cms.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete CMSPage', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.cms.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php index 5fb6fb511..dcd3039c5 100644 --- a/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CartRuleDataGrid.php @@ -28,9 +28,11 @@ class CartRuleDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', - 'label' => trans('admin::app.datagrid.id'), + 'label' => trans('admin::app.id'), 'type' => 'number', 'searchable' => false, 'sortable' => true, @@ -39,7 +41,7 @@ class CartRuleDataGrid extends DataGrid $this->addColumn([ 'index' => 'name', - 'label' => trans('admin::app.datagrid.name'), + 'label' => trans('admin::app.name'), 'type' => 'string', 'searchable' => true, 'sortable' => true, @@ -48,7 +50,7 @@ class CartRuleDataGrid extends DataGrid $this->addColumn([ 'index' => 'status', - 'label' => trans('admin::app.datagrid.status'), + 'label' => trans('admin::app.status'), 'type' => 'boolean', 'searchable' => true, 'sortable' => true, @@ -117,14 +119,14 @@ class CartRuleDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit CartRule', 'method' => 'GET', //use post only for redirects only 'route' => 'admin.cart-rule.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete CartRule', 'method' => 'POST', //use post only for requests other than redirects 'route' => 'admin.cart-rule.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php index 95f90de2f..78bcc54fe 100644 --- a/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CatalogRuleDataGrid.php @@ -28,6 +28,8 @@ class CatalogRuleDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -107,14 +109,14 @@ class CatalogRuleDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit CatalogRule', 'method' => 'GET', //use post only for redirects only 'route' => 'admin.catalog-rule.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete CatalogRule', 'method' => 'POST', //use post only for requests other than redirects 'route' => 'admin.catalog-rule.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php index 30ec08e06..29f84b5bc 100755 --- a/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CategoryDataGrid.php @@ -37,6 +37,8 @@ class CategoryDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'category_id', 'label' => trans('admin::app.datagrid.id'), @@ -91,14 +93,14 @@ class CategoryDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Category', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.catalog.categories.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Category', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.catalog.categories.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php index 86ed8f246..310f5b8f9 100755 --- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php @@ -26,6 +26,8 @@ class ChannelDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -65,14 +67,14 @@ class ChannelDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Channel', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.channels.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Channel', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.channels.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), diff --git a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php index 68811fa73..584a8dc7b 100755 --- a/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CurrencyDataGrid.php @@ -26,6 +26,8 @@ class CurrencyDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -56,14 +58,14 @@ class CurrencyDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Currency', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.currencies.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Currency', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.currencies.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php index 4961d4179..38a8b9110 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerDataGrid.php @@ -34,6 +34,8 @@ class CustomerDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'customer_id', 'label' => trans('admin::app.datagrid.id'), @@ -89,7 +91,6 @@ class CustomerDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.customer.edit', 'icon' => 'icon pencil-lg-icon', @@ -97,7 +98,6 @@ class CustomerDataGrid extends DataGrid ]); $this->addAction([ - 'type' => 'Delete', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.customer.delete', 'icon' => 'icon trash-icon', @@ -105,7 +105,6 @@ class CustomerDataGrid extends DataGrid ]); $this->addAction([ - 'type' => 'Add Note', 'method' => 'GET', 'route' => 'admin.customer.note.create', 'icon' => 'icon note-icon', diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php index 541232d08..4f60e92dc 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerGroupDataGrid.php @@ -26,6 +26,8 @@ class CustomerGroupDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => 'ID', @@ -56,14 +58,14 @@ class CustomerGroupDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Customer Group', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.groups.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Customer Group', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.groups.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index ace725170..8f8b20067 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -34,6 +34,8 @@ class CustomerReviewDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'product_review_id', 'label' => trans('admin::app.datagrid.id'), @@ -92,14 +94,14 @@ class CustomerReviewDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Customer Review', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.customer.review.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Customer Review', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.customer.review.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php index 2970a6f9b..e640e53b2 100755 --- a/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ExchangeRatesDataGrid.php @@ -28,6 +28,8 @@ class ExchangeRatesDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'currency_exch_id', 'label' => trans('admin::app.datagrid.id'), @@ -58,14 +60,14 @@ class ExchangeRatesDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Exchange Rate', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.exchange_rates.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Exchange Rate', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.exchange_rates.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']), diff --git a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php index e91948a1b..2e22971c4 100755 --- a/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/InventorySourcesDataGrid.php @@ -26,6 +26,8 @@ class InventorySourcesDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -80,14 +82,14 @@ class InventorySourcesDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Inventory Source', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.inventory_sources.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Inventory Source', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.inventory_sources.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']), diff --git a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php index cf1f7b562..d17d25026 100755 --- a/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/LocalesDataGrid.php @@ -26,6 +26,8 @@ class LocalesDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -65,14 +67,14 @@ class LocalesDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Locales', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.locales.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Locales', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.locales.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']), diff --git a/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php b/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php index 1d9501a76..69c76a37a 100755 --- a/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/NewsLetterDataGrid.php @@ -26,6 +26,8 @@ class NewsLetterDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -62,14 +64,14 @@ class NewsLetterDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit News Letter', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.customers.subscribers.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete News Letter', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.customers.subscribers.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Exchange Rate']), diff --git a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php index 8578ecf3a..a0154631c 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderDataGrid.php @@ -42,6 +42,8 @@ class OrderDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -134,7 +136,7 @@ class OrderDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'View', + 'title' => 'Order View', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.sales.orders.view', 'icon' => 'icon eye-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index 214f7cc3c..e6136bdd3 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -26,6 +26,8 @@ class OrderInvoicesDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -65,7 +67,7 @@ class OrderInvoicesDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'View', + 'title' => 'Order Invoice View', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.sales.invoices.view', 'icon' => 'icon eye-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php index dd3392b70..e1be10ce5 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderShipmentsDataGrid.php @@ -42,6 +42,8 @@ class OrderShipmentsDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'shipment_id', 'label' => trans('admin::app.datagrid.id'), @@ -108,7 +110,7 @@ class OrderShipmentsDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'View', + 'title' => 'Order Shipment View', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.sales.shipments.view', 'icon' => 'icon eye-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php index 0e8fab459..812f7c3d8 100644 --- a/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ProductDataGrid.php @@ -42,6 +42,8 @@ class ProductDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'product_id', 'label' => trans('admin::app.datagrid.id'), @@ -129,14 +131,14 @@ class ProductDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Product', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.catalog.products.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Product', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.catalog.products.delete', 'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'product']), diff --git a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php index e1b4ebdfc..bbba4cee3 100755 --- a/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/RolesDataGrid.php @@ -26,6 +26,8 @@ class RolesDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -57,14 +59,14 @@ class RolesDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.roles.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.roles.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php index 2a6964640..263dfc098 100755 --- a/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/SliderDataGrid.php @@ -30,6 +30,8 @@ class SliderDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'slider_id', 'label' => trans('admin::app.datagrid.id'), @@ -60,14 +62,14 @@ class SliderDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Slider', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.sliders.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Slider', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.sliders.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php index 8d3d8a266..94c4dd13b 100755 --- a/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxCategoryDataGrid.php @@ -26,6 +26,8 @@ class TaxCategoryDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -56,14 +58,14 @@ class TaxCategoryDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Tax Category', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.tax-categories.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Tax Category', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.tax-categories.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php index eb7d0ae1b..ed7dfa240 100755 --- a/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/TaxRateDataGrid.php @@ -26,6 +26,8 @@ class TaxRateDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'id', 'label' => trans('admin::app.datagrid.id'), @@ -101,14 +103,14 @@ class TaxRateDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit Tax Rate', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.tax-rates.store', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete Tax Rate', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.tax-rates.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php index 8bcf6454d..9a60fbecf 100755 --- a/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/UserDataGrid.php @@ -30,6 +30,8 @@ class UserDataGrid extends DataGrid public function addColumns() { + $this->setInvoker($this); + $this->addColumn([ 'index' => 'user_id', 'label' => trans('admin::app.datagrid.id'), @@ -85,14 +87,14 @@ class UserDataGrid extends DataGrid public function prepareActions() { $this->addAction([ - 'type' => 'Edit', + 'title' => 'Edit User', 'method' => 'GET', // use GET request only for redirect purposes 'route' => 'admin.users.edit', 'icon' => 'icon pencil-lg-icon' ]); $this->addAction([ - 'type' => 'Delete', + 'title' => 'Delete User', 'method' => 'POST', // use GET request only for redirect purposes 'route' => 'admin.users.delete', 'icon' => 'icon trash-icon' diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 4c76748e2..174f91726 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -11,6 +11,9 @@ return [ 'no result' => 'No result', 'product' => 'Product', 'attribute' => 'Attribute', + 'actions' => 'Actions', + 'id' => 'ID', + 'action' => 'action', 'yes' => 'Yes', 'no' => 'No', 'true' => 'True', @@ -18,6 +21,16 @@ return [ 'apply' => 'Apply', 'action' => 'Action', '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' => [ 'no-result-found' => 'We could not find any records.', diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php index 2fabeccf0..47f606e3e 100644 --- a/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/promotions/cart-rule/create.blade.php @@ -188,7 +188,7 @@