Email marketing added
This commit is contained in:
parent
8ff2c87288
commit
642fc1b10d
|
|
@ -19,7 +19,9 @@
|
|||
"ext-tokenizer": "*",
|
||||
"algolia/algoliasearch-client-php": "^2.2",
|
||||
"astrotomic/laravel-translatable": "^11.0.0",
|
||||
"aws/aws-sdk-php": "^3.171",
|
||||
"babenkoivan/elastic-scout-driver": "^1.1",
|
||||
"bagisto/bagisto-package-generator": "9999999-dev",
|
||||
"bagistobrasil/bagisto-product-social-share": "^0.1.2",
|
||||
"barryvdh/laravel-dompdf": "0.8.6",
|
||||
"doctrine/dbal": "2.9.2",
|
||||
|
|
@ -109,7 +111,8 @@
|
|||
"Webkul\\Velocity\\": "packages/Webkul/Velocity/src",
|
||||
"Webkul\\BookingProduct\\": "packages/Webkul/BookingProduct/src",
|
||||
"Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src",
|
||||
"Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src"
|
||||
"Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src",
|
||||
"Webkul\\Marketing\\": "packages/Webkul/Marketing/src"
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "fc14e417d44f0efbc8d33e5ac654fba5",
|
||||
"content-hash": "6717511ca7bb5ca6b8c0101ca6c98609",
|
||||
"packages": [
|
||||
{
|
||||
"name": "algolia/algoliasearch-client-php",
|
||||
|
|
@ -141,6 +141,96 @@
|
|||
],
|
||||
"time": "2020-11-19T14:10:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.171.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "5587d22e63ef82ef74dffca5d47f307b84137b51"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5587d22e63ef82ef74dffca5d47f307b84137b51",
|
||||
"reference": "5587d22e63ef82ef74dffca5d47f307b84137b51",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"ext-pcre": "*",
|
||||
"ext-simplexml": "*",
|
||||
"guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.4.1",
|
||||
"mtdowling/jmespath.php": "^2.5",
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"andrewsville/php-token-reflection": "^1.4",
|
||||
"aws/aws-php-sns-message-validator": "~1.0",
|
||||
"behat/behat": "~3.0",
|
||||
"doctrine/cache": "~1.4",
|
||||
"ext-dom": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-pcntl": "*",
|
||||
"ext-sockets": "*",
|
||||
"nette/neon": "^2.3",
|
||||
"paragonie/random_compat": ">= 2",
|
||||
"phpunit/phpunit": "^4.8.35|^5.4.3",
|
||||
"psr/cache": "^1.0",
|
||||
"psr/simple-cache": "^1.0",
|
||||
"sebastian/comparator": "^1.2.3"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
|
||||
"doctrine/cache": "To use the DoctrineCacheAdapter",
|
||||
"ext-curl": "To send requests using cURL",
|
||||
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
|
||||
"ext-sockets": "To use client-side monitoring"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aws\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Amazon Web Services",
|
||||
"homepage": "http://aws.amazon.com"
|
||||
}
|
||||
],
|
||||
"description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
|
||||
"homepage": "http://aws.amazon.com/sdkforphp",
|
||||
"keywords": [
|
||||
"amazon",
|
||||
"aws",
|
||||
"cloud",
|
||||
"dynamodb",
|
||||
"ec2",
|
||||
"glacier",
|
||||
"s3",
|
||||
"sdk"
|
||||
],
|
||||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.171.6"
|
||||
},
|
||||
"time": "2020-12-23T19:12:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "babenkoivan/elastic-adapter",
|
||||
"version": "v1.9.0",
|
||||
|
|
@ -308,6 +398,52 @@
|
|||
],
|
||||
"time": "2020-07-11T07:35:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bagisto/bagisto-package-generator",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bagisto/bagisto-package-generator.git",
|
||||
"reference": "0b545b26ab47941dbdd319e9222404603a9b8de6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bagisto/bagisto-package-generator/zipball/0b545b26ab47941dbdd319e9222404603a9b8de6",
|
||||
"reference": "0b545b26ab47941dbdd319e9222404603a9b8de6",
|
||||
"shasum": ""
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\PackageGenerator\\Providers\\PackageGeneratorServiceProvider"
|
||||
],
|
||||
"aliases": []
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\PackageGenerator\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jitendra Singh",
|
||||
"email": "jitendra@webkul.com"
|
||||
}
|
||||
],
|
||||
"description": "Bagisto Package Generator",
|
||||
"support": {
|
||||
"issues": "https://github.com/bagisto/bagisto-package-generator/issues",
|
||||
"source": "https://github.com/bagisto/bagisto-package-generator/tree/master"
|
||||
},
|
||||
"time": "2020-08-24T08:41:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bagistobrasil/bagisto-product-social-share",
|
||||
"version": "0.1.2",
|
||||
|
|
@ -3010,6 +3146,67 @@
|
|||
],
|
||||
"time": "2020-07-23T08:41:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mtdowling/jmespath.php",
|
||||
"version": "2.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jmespath/jmespath.php.git",
|
||||
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
|
||||
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.17"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/xdebug-handler": "^1.4",
|
||||
"phpunit/phpunit": "^4.8.36 || ^7.5.15"
|
||||
},
|
||||
"bin": [
|
||||
"bin/jp.php"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"JmesPath\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/JmesPath.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
}
|
||||
],
|
||||
"description": "Declaratively specify how to extract elements from a JSON document",
|
||||
"keywords": [
|
||||
"json",
|
||||
"jsonpath"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/jmespath/jmespath.php/issues",
|
||||
"source": "https://github.com/jmespath/jmespath.php/tree/2.6.0"
|
||||
},
|
||||
"time": "2020-07-31T21:01:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/php-enum",
|
||||
"version": "1.7.7",
|
||||
|
|
@ -9163,7 +9360,9 @@
|
|||
],
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": [],
|
||||
"stability-flags": {
|
||||
"bagisto/bagisto-package-generator": 20
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
|
|
@ -9176,5 +9375,6 @@
|
|||
"ext-pdo_mysql": "*",
|
||||
"ext-tokenizer": "*"
|
||||
},
|
||||
"platform-dev": []
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.0.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ return [
|
|||
Webkul\BookingProduct\Providers\BookingProductServiceProvider::class,
|
||||
Webkul\SocialLogin\Providers\SocialLoginServiceProvider::class,
|
||||
Webkul\DebugBar\Providers\DebugBarServiceProvider::class,
|
||||
Webkul\Marketing\Providers\MarketingServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ return [
|
|||
\Webkul\CMS\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Customer\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Inventory\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Marketing\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Payment\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Paypal\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Product\Providers\ModuleServiceProvider::class,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ return [
|
|||
|
||||
'enabled' => env('DEBUGBAR_ENABLED', null),
|
||||
'except' => [
|
||||
'telescope*'
|
||||
'telescope*',
|
||||
'horizon*',
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
@ -36,7 +37,7 @@ return [
|
|||
'driver' => 'file', // redis, file, pdo, custom
|
||||
'path' => storage_path('debugbar'), // For file driver
|
||||
'connection' => null, // Leave null for default connection (Redis/PDO)
|
||||
'provider' => '' // Instance of StorageInterface for custom driver
|
||||
'provider' => '', // Instance of StorageInterface for custom driver
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
@ -123,6 +124,7 @@ return [
|
|||
'config' => false, // Display config settings
|
||||
'cache' => false, // Display cache events
|
||||
'models' => true, // Display models
|
||||
'livewire' => true, // Display Livewire (when available)
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
@ -141,27 +143,29 @@ return [
|
|||
'db' => [
|
||||
'with_params' => true, // Render SQL with the parameters substituted
|
||||
'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
|
||||
'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults)
|
||||
'timeline' => false, // Add the queries to the timeline
|
||||
'explain' => [ // Show EXPLAIN output on queries
|
||||
'enabled' => false,
|
||||
'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
|
||||
'types' => ['SELECT'], // Deprecated setting, is always only SELECT
|
||||
],
|
||||
'hints' => true, // Show hints for common mistakes
|
||||
'hints' => false, // Show hints for common mistakes
|
||||
'show_copy' => false, // Show copy button next to the query
|
||||
],
|
||||
'mail' => [
|
||||
'full_log' => false
|
||||
'full_log' => false,
|
||||
],
|
||||
'views' => [
|
||||
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
||||
],
|
||||
'route' => [
|
||||
'label' => true // show complete route on bar
|
||||
'label' => true, // show complete route on bar
|
||||
],
|
||||
'logs' => [
|
||||
'file' => null
|
||||
'file' => null,
|
||||
],
|
||||
'cache' => [
|
||||
'values' => true // collect cache values
|
||||
'values' => true, // collect cache values
|
||||
],
|
||||
],
|
||||
|
||||
|
|
@ -199,4 +203,14 @@ return [
|
|||
| To override default domain, specify it as a non-empty value.
|
||||
*/
|
||||
'route_domain' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DebugBar theme
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Switches between light and dark theme. If set to auto it will respect system preferences
|
||||
| Possible values: auto, light, dark
|
||||
*/
|
||||
'theme' => 'auto',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'hosts' => [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'refresh_documents' => env('ELASTIC_SCOUT_DRIVER_REFRESH_DOCUMENTS', false)
|
||||
'refresh_documents' => env('ELASTIC_SCOUT_DRIVER_REFRESH_DOCUMENTS', false),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ return [
|
|||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Alias Whitelist
|
||||
| Auto Aliased Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Tinker will not automatically alias classes in your vendor namespaces
|
||||
|
|
@ -34,7 +34,7 @@ return [
|
|||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Alias Blacklist
|
||||
| Classes That Should Not Be Aliased
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Typically, Tinker automatically aliases classes as you require them in
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddColumnUrlPathToCategoryTranslations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('category_translations', function (Blueprint $table) {
|
||||
$table->string('url_path', 2048)
|
||||
->comment('maintained by database triggers');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('category_translations', function (Blueprint $table) {
|
||||
$table->dropColumn('url_path');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStoredFunctionToGetUrlPathOfCategory extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$functionSQL = <<< SQL
|
||||
DROP FUNCTION IF EXISTS `get_url_path_of_category`;
|
||||
CREATE FUNCTION get_url_path_of_category(
|
||||
categoryId INT,
|
||||
localeCode VARCHAR(255)
|
||||
)
|
||||
RETURNS VARCHAR(255)
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
|
||||
DECLARE urlPath VARCHAR(255);
|
||||
-- Category with id 1 is root by default
|
||||
IF categoryId <> 1
|
||||
THEN
|
||||
SELECT
|
||||
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO urlPath
|
||||
FROM
|
||||
${dbPrefix}categories AS node,
|
||||
${dbPrefix}categories AS parent
|
||||
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
|
||||
WHERE
|
||||
node._lft >= parent._lft
|
||||
AND node._rgt <= parent._rgt
|
||||
AND node.id = categoryId
|
||||
AND parent.id <> 1
|
||||
AND parent_translations.locale = localeCode
|
||||
GROUP BY
|
||||
node.id;
|
||||
|
||||
IF urlPath IS NULL
|
||||
THEN
|
||||
SET urlPath = (SELECT slug FROM ${dbPrefix}category_translations WHERE ${dbPrefix}category_translations.category_id = categoryId);
|
||||
END IF;
|
||||
ELSE
|
||||
SET urlPath = '';
|
||||
END IF;
|
||||
|
||||
RETURN urlPath;
|
||||
END;
|
||||
SQL;
|
||||
|
||||
DB::unprepared($functionSQL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::unprepared('DROP FUNCTION IF EXISTS `get_url_path_of_category`;');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Webkul\Category\Models\CategoryTranslation;
|
||||
|
||||
class AddTriggerToCategoryTranslations extends Migration
|
||||
{
|
||||
private const TRIGGER_NAME_INSERT = 'trig_category_translations_insert';
|
||||
private const TRIGGER_NAME_UPDATE = 'trig_category_translations_update';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$triggerBody = $this->getTriggerBody();
|
||||
$insertTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
BEFORE INSERT ON ${dbPrefix}category_translations
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$updateTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
BEFORE UPDATE ON ${dbPrefix}category_translations
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
|
||||
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns trigger body as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTriggerBody()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
return <<<SQL
|
||||
DECLARE parentUrlPath varchar(255);
|
||||
DECLARE urlPath varchar(255);
|
||||
|
||||
-- Category with id 1 is root by default
|
||||
IF NEW.category_id <> 1
|
||||
THEN
|
||||
|
||||
SELECT
|
||||
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO parentUrlPath
|
||||
FROM
|
||||
${dbPrefix}categories AS node,
|
||||
${dbPrefix}categories AS parent
|
||||
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
|
||||
WHERE
|
||||
node._lft >= parent._lft
|
||||
AND node._rgt <= parent._rgt
|
||||
AND node.id = (SELECT parent_id FROM categories WHERE id = NEW.category_id)
|
||||
AND parent.id <> 1
|
||||
AND parent_translations.locale = NEW.locale
|
||||
GROUP BY
|
||||
node.id;
|
||||
|
||||
IF parentUrlPath IS NULL
|
||||
THEN
|
||||
SET urlPath = NEW.slug;
|
||||
ELSE
|
||||
SET urlPath = concat(parentUrlPath, '/', NEW.slug);
|
||||
END IF;
|
||||
|
||||
SET NEW.url_path = urlPath;
|
||||
|
||||
END IF;
|
||||
SQL;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Webkul\Category\Models\CategoryTranslation;
|
||||
|
||||
class AddUrlPathToExistingCategoryTranslations extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$sqlStoredFunction = <<< SQL
|
||||
SELECT get_url_path_of_category(:category_id, :locale_code) AS url_path;
|
||||
SQL;
|
||||
|
||||
|
||||
$categoryTranslationsTableName = app(CategoryTranslation::class)->getTable();
|
||||
|
||||
foreach (DB::table($categoryTranslationsTableName)->get() as $categoryTranslation) {
|
||||
$urlPathQueryResult = DB::selectOne($sqlStoredFunction, [
|
||||
'category_id' => $categoryTranslation->category_id,
|
||||
'locale_code' => $categoryTranslation->locale,
|
||||
]);
|
||||
$url_path = $urlPathQueryResult ? $urlPathQueryResult->url_path : '';
|
||||
|
||||
DB::table($categoryTranslationsTableName)
|
||||
->where('id', $categoryTranslation->id)
|
||||
->update(['url_path' => $url_path]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddTriggerToCategories extends Migration
|
||||
{
|
||||
private const TRIGGER_NAME_INSERT = 'trig_categories_insert';
|
||||
private const TRIGGER_NAME_UPDATE = 'trig_categories_update';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$triggerBody = $this->getTriggerBody();
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$insertTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
AFTER INSERT ON ${dbPrefix}categories
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$updateTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
AFTER UPDATE ON ${dbPrefix}categories
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
|
||||
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns trigger body as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTriggerBody(): string
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
return <<< SQL
|
||||
DECLARE urlPath VARCHAR(255);
|
||||
DECLARE localeCode VARCHAR(255);
|
||||
DECLARE done INT;
|
||||
DECLARE curs CURSOR FOR (SELECT ${dbPrefix}category_translations.locale
|
||||
FROM ${dbPrefix}category_translations
|
||||
WHERE category_id = NEW.id);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
||||
|
||||
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM ${dbPrefix}category_translations
|
||||
WHERE category_id = NEW.id
|
||||
)
|
||||
THEN
|
||||
|
||||
OPEN curs;
|
||||
|
||||
SET done = 0;
|
||||
REPEAT
|
||||
FETCH curs INTO localeCode;
|
||||
|
||||
SELECT get_url_path_of_category(NEW.id, localeCode) INTO urlPath;
|
||||
|
||||
UPDATE ${dbPrefix}category_translations
|
||||
SET url_path = urlPath
|
||||
WHERE ${dbPrefix}category_translations.category_id = NEW.id;
|
||||
|
||||
UNTIL done END REPEAT;
|
||||
|
||||
CLOSE curs;
|
||||
|
||||
END IF;
|
||||
SQL;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AlterTriggerCategoryTranslations extends Migration
|
||||
{
|
||||
private const TRIGGER_NAME_INSERT = 'trig_category_translations_insert';
|
||||
private const TRIGGER_NAME_UPDATE = 'trig_category_translations_update';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$triggerBody = $this->getTriggerBody();
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$insertTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
BEFORE INSERT ON ${dbPrefix}category_translations
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$updateTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
BEFORE UPDATE ON ${dbPrefix}category_translations
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$this->dropTriggers();
|
||||
|
||||
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTriggers();
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop the triggers
|
||||
*/
|
||||
private function dropTriggers()
|
||||
{
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns trigger body as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTriggerBody()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
return <<<SQL
|
||||
DECLARE parentUrlPath varchar(255);
|
||||
DECLARE urlPath varchar(255);
|
||||
|
||||
IF NOT EXISTS (
|
||||
SELECT id
|
||||
FROM ${dbPrefix}categories
|
||||
WHERE
|
||||
id = NEW.category_id
|
||||
AND parent_id IS NULL
|
||||
)
|
||||
THEN
|
||||
|
||||
SELECT
|
||||
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO parentUrlPath
|
||||
FROM
|
||||
${dbPrefix}categories AS node,
|
||||
${dbPrefix}categories AS parent
|
||||
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
|
||||
WHERE
|
||||
node._lft >= parent._lft
|
||||
AND node._rgt <= parent._rgt
|
||||
AND node.id = (SELECT parent_id FROM ${dbPrefix}categories WHERE id = NEW.category_id)
|
||||
AND node.parent_id IS NOT NULL
|
||||
AND parent.parent_id IS NOT NULL
|
||||
AND parent_translations.locale = NEW.locale
|
||||
GROUP BY
|
||||
node.id;
|
||||
|
||||
IF parentUrlPath IS NULL
|
||||
THEN
|
||||
SET urlPath = NEW.slug;
|
||||
ELSE
|
||||
SET urlPath = concat(parentUrlPath, '/', NEW.slug);
|
||||
END IF;
|
||||
|
||||
SET NEW.url_path = urlPath;
|
||||
|
||||
END IF;
|
||||
SQL;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AlterStoredFunctionUrlPathCategory extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$functionSQL = <<< SQL
|
||||
DROP FUNCTION IF EXISTS `get_url_path_of_category`;
|
||||
CREATE FUNCTION get_url_path_of_category(
|
||||
categoryId INT,
|
||||
localeCode VARCHAR(255)
|
||||
)
|
||||
RETURNS VARCHAR(255)
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
|
||||
DECLARE urlPath VARCHAR(255);
|
||||
|
||||
IF NOT EXISTS (
|
||||
SELECT id
|
||||
FROM ${dbPrefix}categories
|
||||
WHERE
|
||||
id = categoryId
|
||||
AND parent_id IS NULL
|
||||
)
|
||||
THEN
|
||||
SELECT
|
||||
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO urlPath
|
||||
FROM
|
||||
${dbPrefix}categories AS node,
|
||||
${dbPrefix}categories AS parent
|
||||
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
|
||||
WHERE
|
||||
node._lft >= parent._lft
|
||||
AND node._rgt <= parent._rgt
|
||||
AND node.id = categoryId
|
||||
AND node.parent_id IS NOT NULL
|
||||
AND parent.parent_id IS NOT NULL
|
||||
AND parent_translations.locale = localeCode
|
||||
GROUP BY
|
||||
node.id;
|
||||
|
||||
IF urlPath IS NULL
|
||||
THEN
|
||||
SET urlPath = (SELECT slug FROM ${dbPrefix}category_translations WHERE ${dbPrefix}category_translations.category_id = categoryId);
|
||||
END IF;
|
||||
ELSE
|
||||
SET urlPath = '';
|
||||
END IF;
|
||||
|
||||
RETURN urlPath;
|
||||
END;
|
||||
SQL;
|
||||
|
||||
DB::unprepared($functionSQL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::unprepared('DROP FUNCTION IF EXISTS `get_url_path_of_category`;');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AlterTriggerOnCategories extends Migration
|
||||
{
|
||||
private const TRIGGER_NAME_INSERT = 'trig_categories_insert';
|
||||
private const TRIGGER_NAME_UPDATE = 'trig_categories_update';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$triggerBody = $this->getTriggerBody();
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
$insertTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
AFTER INSERT ON ${dbPrefix}categories
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$updateTrigger = <<< SQL
|
||||
CREATE TRIGGER %s
|
||||
AFTER UPDATE ON ${dbPrefix}categories
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
$triggerBody
|
||||
END;
|
||||
SQL;
|
||||
|
||||
$this->dropTriggers();
|
||||
|
||||
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
|
||||
|
||||
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$this->dropTriggers();
|
||||
}
|
||||
|
||||
private function dropTriggers()
|
||||
{
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
|
||||
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns trigger body as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getTriggerBody(): string
|
||||
{
|
||||
$dbPrefix = DB::getTablePrefix();
|
||||
|
||||
return <<< SQL
|
||||
DECLARE urlPath VARCHAR(255);
|
||||
DECLARE localeCode VARCHAR(255);
|
||||
DECLARE done INT;
|
||||
DECLARE curs CURSOR FOR (SELECT ${dbPrefix}category_translations.locale
|
||||
FROM ${dbPrefix}category_translations
|
||||
WHERE category_id = NEW.id);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
||||
|
||||
|
||||
IF EXISTS (
|
||||
SELECT *
|
||||
FROM ${dbPrefix}category_translations
|
||||
WHERE category_id = NEW.id
|
||||
)
|
||||
THEN
|
||||
|
||||
OPEN curs;
|
||||
|
||||
SET done = 0;
|
||||
REPEAT
|
||||
FETCH curs INTO localeCode;
|
||||
|
||||
SELECT get_url_path_of_category(NEW.id, localeCode) INTO urlPath;
|
||||
|
||||
IF NEW.parent_id IS NULL
|
||||
THEN
|
||||
SET urlPath = '';
|
||||
END IF;
|
||||
|
||||
UPDATE ${dbPrefix}category_translations
|
||||
SET url_path = urlPath
|
||||
WHERE
|
||||
${dbPrefix}category_translations.category_id = NEW.id
|
||||
AND ${dbPrefix}category_translations.locale = localeCode;
|
||||
|
||||
UNTIL done END REPEAT;
|
||||
|
||||
CLOSE curs;
|
||||
|
||||
END IF;
|
||||
SQL;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJobsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
}
|
||||
}
|
||||
|
|
@ -392,51 +392,136 @@ return [
|
|||
'route' => 'admin.tax-rates.delete',
|
||||
'sort' => 3,
|
||||
], [
|
||||
'key' => 'promotions',
|
||||
'key' => 'marketing',
|
||||
'name' => 'admin::app.acl.marketing',
|
||||
'route' => 'admin.cart-rules.index',
|
||||
'sort' => 7,
|
||||
], [
|
||||
'key' => 'marketing.promotions',
|
||||
'name' => 'admin::app.acl.promotions',
|
||||
'route' => 'admin.cart-rules.index',
|
||||
'sort' => 7,
|
||||
], [
|
||||
'key' => 'promotions.cart-rules',
|
||||
'key' => 'marketing.promotions.cart-rules',
|
||||
'name' => 'admin::app.acl.cart-rules',
|
||||
'route' => 'admin.cart-rules.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'promotions.cart-rules.create',
|
||||
'key' => 'marketing.promotions.cart-rules.create',
|
||||
'name' => 'admin::app.acl.create',
|
||||
'route' => 'admin.cart-rules.create',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'promotions.cart-rules.edit',
|
||||
'key' => 'marketing.promotions.cart-rules.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.cart-rules.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'promotions.cart-rules.delete',
|
||||
'key' => 'marketing.promotions.cart-rules.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.cart-rules.delete',
|
||||
'sort' => 3,
|
||||
], [
|
||||
'key' => 'promotions.catalog-rules',
|
||||
'key' => 'marketing.promotions.catalog-rules',
|
||||
'name' => 'admin::app.acl.catalog-rules',
|
||||
'route' => 'admin.catalog-rules.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'promotions.catalog-rules.create',
|
||||
'key' => 'marketing.promotions.catalog-rules.create',
|
||||
'name' => 'admin::app.acl.create',
|
||||
'route' => 'admin.catalog-rules.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'promotions.catalog-rules.edit',
|
||||
'key' => 'marketing.promotions.catalog-rules.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.catalog-rules.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'promotions.catalog-rules.delete',
|
||||
'key' => 'marketing.promotions.catalog-rules.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.catalog-rules.delete',
|
||||
'sort' => 3,
|
||||
],
|
||||
], [
|
||||
'key' => 'marketing.email-marketing',
|
||||
'name' => 'admin::app.acl.email-marketing',
|
||||
'route' => 'admin.email-templates.index',
|
||||
'sort' => 7,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.email-templates',
|
||||
'name' => 'admin::app.acl.email-templates',
|
||||
'route' => 'admin.email-templates.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.email-templates.create',
|
||||
'name' => 'admin::app.acl.create',
|
||||
'route' => 'admin.email-templates.create',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.email-templates.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.email-templates.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.email-templates.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.email-templates.delete',
|
||||
'sort' => 3,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.events',
|
||||
'name' => 'admin::app.acl.events',
|
||||
'route' => 'admin.events.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.events.create',
|
||||
'name' => 'admin::app.acl.create',
|
||||
'route' => 'admin.events.create',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.events.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.events.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.events.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.events.delete',
|
||||
'sort' => 3,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.campaigns',
|
||||
'name' => 'admin::app.acl.campaigns',
|
||||
'route' => 'admin.campaigns.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.campaigns.create',
|
||||
'name' => 'admin::app.acl.create',
|
||||
'route' => 'admin.campaigns.create',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.campaigns.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.campaigns.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.campaigns.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.campaigns.delete',
|
||||
'sort' => 3,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.subscribers',
|
||||
'name' => 'admin::app.acl.subscribers',
|
||||
'route' => 'admin.subscribers.index',
|
||||
'sort' => 1,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.subscribers.edit',
|
||||
'name' => 'admin::app.acl.edit',
|
||||
'route' => 'admin.subscribers.edit',
|
||||
'sort' => 2,
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.subscribers.delete',
|
||||
'name' => 'admin::app.acl.delete',
|
||||
'route' => 'admin.subscribers.delete',
|
||||
'sort' => 3,
|
||||
]
|
||||
];
|
||||
|
||||
?>
|
||||
|
|
@ -91,12 +91,6 @@ return [
|
|||
'route' => 'admin.customer.review.index',
|
||||
'sort' => 3,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'customers.subscribers',
|
||||
'name' => 'admin::app.layouts.newsletter-subscriptions',
|
||||
'route' => 'admin.customers.subscribers.index',
|
||||
'sort' => 4,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'configuration',
|
||||
'name' => 'admin::app.layouts.configure',
|
||||
|
|
@ -182,23 +176,59 @@ return [
|
|||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'promotions',
|
||||
'name' => 'admin::app.layouts.promotions',
|
||||
'key' => 'marketing',
|
||||
'name' => 'admin::app.layouts.marketing',
|
||||
'route' => 'admin.catalog-rules.index',
|
||||
'sort' => 5,
|
||||
'icon-class' => 'promotion-icon',
|
||||
], [
|
||||
'key' => 'promotions.catalog-rules',
|
||||
'key' => 'marketing.promotions',
|
||||
'name' => 'admin::app.layouts.promotions',
|
||||
'route' => 'admin.catalog-rules.index',
|
||||
'sort' => 1,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.promotions.catalog-rules',
|
||||
'name' => 'admin::app.promotions.catalog-rules.title',
|
||||
'route' => 'admin.catalog-rules.index',
|
||||
'sort' => 1,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'promotions.cart-rules',
|
||||
'key' => 'marketing.promotions.cart-rules',
|
||||
'name' => 'admin::app.promotions.cart-rules.title',
|
||||
'route' => 'admin.cart-rules.index',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.email-marketing',
|
||||
'name' => 'admin::app.layouts.email-marketing',
|
||||
'route' => 'admin.email-templates.index',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.email-templates',
|
||||
'name' => 'admin::app.layouts.email-templates',
|
||||
'route' => 'admin.email-templates.index',
|
||||
'sort' => 1,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.events',
|
||||
'name' => 'admin::app.layouts.events',
|
||||
'route' => 'admin.events.index',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.campaigns',
|
||||
'name' => 'admin::app.layouts.campaigns',
|
||||
'route' => 'admin.campaigns.index',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'marketing.email-marketing.subscribers',
|
||||
'name' => 'admin::app.layouts.newsletter-subscriptions',
|
||||
'route' => 'admin.customers.subscribers.index',
|
||||
'sort' => 3,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'cms',
|
||||
'name' => 'admin::app.layouts.cms',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
|
||||
class CampaignDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
protected $sortOrder = 'desc';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('marketing_campaigns')->addSelect('id', 'name', 'subject', 'status');
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'name',
|
||||
'label' => trans('admin::app.datagrid.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'subject',
|
||||
'label' => trans('admin::app.datagrid.subject'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'status',
|
||||
'label' => trans('admin::app.status'),
|
||||
'type' => 'boolean',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->status == 1) {
|
||||
return trans('admin::app.datagrid.active');
|
||||
} else {
|
||||
return trans('admin::app.datagrid.inactive');
|
||||
}
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.edit'),
|
||||
'method' => 'GET',
|
||||
'route' => 'admin.campaigns.edit',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.delete'),
|
||||
'method' => 'POST',
|
||||
'route' => 'admin.campaigns.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Campaign']),
|
||||
'icon' => 'icon trash-icon',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -120,10 +120,12 @@ class CartRuleDataGrid extends DataGrid
|
|||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->status == 1) {
|
||||
if ($value->status == 'active') {
|
||||
return trans('admin::app.datagrid.active');
|
||||
} else {
|
||||
} else if ($value->status == 'inactive') {
|
||||
return trans('admin::app.datagrid.inactive');
|
||||
} else {
|
||||
return trans('admin::app.datagrid.draft');
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
|
||||
class EmailTemplateDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
protected $sortOrder = 'desc';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('marketing_templates')->addSelect('id', 'name', 'status');
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'name',
|
||||
'label' => trans('admin::app.datagrid.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'status',
|
||||
'label' => trans('admin::app.status'),
|
||||
'type' => 'boolean',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
'wrapper' => function ($value) {
|
||||
if ($value->status == 'active') {
|
||||
return trans('admin::app.datagrid.active');
|
||||
} else if ($value->status == 'inactive') {
|
||||
return trans('admin::app.datagrid.inactive');
|
||||
} else if ($value->status == 'draft') {
|
||||
return trans('admin::app.datagrid.draft');
|
||||
}
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.edit'),
|
||||
'method' => 'GET',
|
||||
'route' => 'admin.email-templates.edit',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.delete'),
|
||||
'method' => 'POST',
|
||||
'route' => 'admin.email-templates.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Email Template']),
|
||||
'icon' => 'icon trash-icon',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Admin\DataGrids;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Webkul\Ui\DataGrid\DataGrid;
|
||||
|
||||
class EventDataGrid extends DataGrid
|
||||
{
|
||||
protected $index = 'id';
|
||||
|
||||
protected $sortOrder = 'desc';
|
||||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('marketing_events')->addSelect('id', 'name', 'date');
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
||||
public function addColumns()
|
||||
{
|
||||
$this->addColumn([
|
||||
'index' => 'id',
|
||||
'label' => trans('admin::app.datagrid.id'),
|
||||
'type' => 'number',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'name',
|
||||
'label' => trans('admin::app.datagrid.name'),
|
||||
'type' => 'string',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
|
||||
$this->addColumn([
|
||||
'index' => 'date',
|
||||
'label' => trans('admin::app.datagrid.date'),
|
||||
'type' => 'date',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'filterable' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function prepareActions()
|
||||
{
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.edit'),
|
||||
'method' => 'GET',
|
||||
'route' => 'admin.events.edit',
|
||||
'icon' => 'icon pencil-lg-icon',
|
||||
]);
|
||||
|
||||
$this->addAction([
|
||||
'title' => trans('admin::app.datagrid.delete'),
|
||||
'method' => 'POST',
|
||||
'route' => 'admin.events.delete',
|
||||
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Event']),
|
||||
'icon' => 'icon trash-icon',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ class CustomerGroupController extends Controller
|
|||
|
||||
if ($customerGroup->is_user_defined == 0) {
|
||||
session()->flash('warning', trans('admin::app.customers.customers.group-default'));
|
||||
} elseif (count($customerGroup->customer) > 0) {
|
||||
} elseif (count($customerGroup->customers) > 0) {
|
||||
session()->flash('warning', trans('admin::app.response.customer-associate', ['name' => 'Customer Group']));
|
||||
} else {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -583,23 +583,6 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
|
||||
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
|
||||
|
||||
|
||||
// Admin Store Front Settings Route
|
||||
Route::get('/subscribers', 'Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config', [
|
||||
'view' => 'admin::customers.subscribers.index',
|
||||
])->name('admin.customers.subscribers.index');
|
||||
|
||||
//destroy a newsletter subscription item
|
||||
Route::post('subscribers/delete/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@destroy')->name('admin.customers.subscribers.delete');
|
||||
|
||||
Route::get('subscribers/edit/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@edit')->defaults('_config', [
|
||||
'view' => 'admin::customers.subscribers.edit',
|
||||
])->name('admin.customers.subscribers.edit');
|
||||
|
||||
Route::put('subscribers/update/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@update')->defaults('_config', [
|
||||
'redirect' => 'admin.customers.subscribers.index',
|
||||
])->name('admin.customers.subscribers.update');
|
||||
|
||||
//slider index
|
||||
Route::get('/slider', 'Webkul\Core\Http\Controllers\SliderController@index')->defaults('_config', [
|
||||
'view' => 'admin::settings.sliders.index',
|
||||
|
|
@ -688,11 +671,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
|
||||
Route::prefix('promotions')->group(function () {
|
||||
Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [
|
||||
'view' => 'admin::promotions.cart-rules.index',
|
||||
'view' => 'admin::marketing.promotions.cart-rules.index',
|
||||
])->name('admin.cart-rules.index');
|
||||
|
||||
Route::get('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@create')->defaults('_config', [
|
||||
'view' => 'admin::promotions.cart-rules.create',
|
||||
'view' => 'admin::marketing.promotions.cart-rules.create',
|
||||
])->name('admin.cart-rules.create');
|
||||
|
||||
Route::post('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@store')->defaults('_config', [
|
||||
|
|
@ -700,11 +683,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
])->name('admin.cart-rules.store');
|
||||
|
||||
Route::get('cart-rules/copy/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@copy')->defaults('_config', [
|
||||
'view' => 'admin::promotions.cart-rules.edit',
|
||||
'view' => 'admin::marketing.promotions.cart-rules.edit',
|
||||
])->name('admin.cart-rules.copy');
|
||||
|
||||
Route::get('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@edit')->defaults('_config', [
|
||||
'view' => 'admin::promotions.cart-rules.edit',
|
||||
'view' => 'admin::marketing.promotions.cart-rules.edit',
|
||||
])->name('admin.cart-rules.edit');
|
||||
|
||||
Route::post('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@update')->defaults('_config', [
|
||||
|
|
@ -720,11 +703,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
|
||||
//Catalog rules
|
||||
Route::get('catalog-rules', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@index')->defaults('_config', [
|
||||
'view' => 'admin::promotions.catalog-rules.index',
|
||||
'view' => 'admin::marketing.promotions.catalog-rules.index',
|
||||
])->name('admin.catalog-rules.index');
|
||||
|
||||
Route::get('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@create')->defaults('_config', [
|
||||
'view' => 'admin::promotions.catalog-rules.create',
|
||||
'view' => 'admin::marketing.promotions.catalog-rules.create',
|
||||
])->name('admin.catalog-rules.create');
|
||||
|
||||
Route::post('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@store')->defaults('_config', [
|
||||
|
|
@ -732,7 +715,7 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
])->name('admin.catalog-rules.store');
|
||||
|
||||
Route::get('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [
|
||||
'view' => 'admin::promotions.catalog-rules.edit',
|
||||
'view' => 'admin::marketing.promotions.catalog-rules.edit',
|
||||
])->name('admin.catalog-rules.edit');
|
||||
|
||||
Route::post('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@update')->defaults('_config', [
|
||||
|
|
@ -740,6 +723,95 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
|
|||
])->name('admin.catalog-rules.update');
|
||||
|
||||
Route::post('catalog-rules/delete/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rules.delete');
|
||||
|
||||
|
||||
//Marketing campaigns routes
|
||||
Route::get('campaigns', 'Webkul\Marketing\Http\Controllers\CampaignController@index')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.campaigns.index',
|
||||
])->name('admin.campaigns.index');
|
||||
|
||||
Route::get('campaigns/create', 'Webkul\Marketing\Http\Controllers\CampaignController@create')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.campaigns.create',
|
||||
])->name('admin.campaigns.create');
|
||||
|
||||
Route::post('campaigns/create', 'Webkul\Marketing\Http\Controllers\CampaignController@store')->defaults('_config', [
|
||||
'redirect' => 'admin.campaigns.index',
|
||||
])->name('admin.campaigns.store');
|
||||
|
||||
Route::get('campaigns/edit/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@edit')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.campaigns.edit',
|
||||
])->name('admin.campaigns.edit');
|
||||
|
||||
Route::post('campaigns/edit/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@update')->defaults('_config', [
|
||||
'redirect' => 'admin.campaigns.index',
|
||||
])->name('admin.campaigns.update');
|
||||
|
||||
Route::post('campaigns/delete/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@destroy')->name('admin.campaigns.delete');
|
||||
|
||||
|
||||
//Marketing emails templates routes
|
||||
Route::get('email-templates', 'Webkul\Marketing\Http\Controllers\TemplateController@index')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.templates.index',
|
||||
])->name('admin.email-templates.index');
|
||||
|
||||
Route::get('email-templates/create', 'Webkul\Marketing\Http\Controllers\TemplateController@create')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.templates.create',
|
||||
])->name('admin.email-templates.create');
|
||||
|
||||
Route::post('email-templates/create', 'Webkul\Marketing\Http\Controllers\TemplateController@store')->defaults('_config', [
|
||||
'redirect' => 'admin.email-templates.index',
|
||||
])->name('admin.email-templates.store');
|
||||
|
||||
Route::get('email-templates/edit/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@edit')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.templates.edit',
|
||||
])->name('admin.email-templates.edit');
|
||||
|
||||
Route::post('email-templates/edit/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@update')->defaults('_config', [
|
||||
'redirect' => 'admin.email-templates.index',
|
||||
])->name('admin.email-templates.update');
|
||||
|
||||
Route::post('email-templates/delete/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@destroy')->name('admin.email-templates.delete');
|
||||
|
||||
|
||||
//Marketing events routes
|
||||
Route::get('events', 'Webkul\Marketing\Http\Controllers\EventController@index')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.events.index',
|
||||
])->name('admin.events.index');
|
||||
|
||||
Route::get('events/create', 'Webkul\Marketing\Http\Controllers\EventController@create')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.events.create',
|
||||
])->name('admin.events.create');
|
||||
|
||||
Route::post('events/create', 'Webkul\Marketing\Http\Controllers\EventController@store')->defaults('_config', [
|
||||
'redirect' => 'admin.events.index',
|
||||
])->name('admin.events.store');
|
||||
|
||||
Route::get('events/edit/{id}', 'Webkul\Marketing\Http\Controllers\EventController@edit')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.events.edit',
|
||||
])->name('admin.events.edit');
|
||||
|
||||
Route::post('events/edit/{id}', 'Webkul\Marketing\Http\Controllers\EventController@update')->defaults('_config', [
|
||||
'redirect' => 'admin.events.index',
|
||||
])->name('admin.events.update');
|
||||
|
||||
Route::post('events/delete/{id}', 'Webkul\Marketing\Http\Controllers\EventController@destroy')->name('admin.events.delete');
|
||||
|
||||
|
||||
// Admin Store Front Settings Route
|
||||
Route::get('/subscribers', 'Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.subscribers.index',
|
||||
])->name('admin.customers.subscribers.index');
|
||||
|
||||
//destroy a newsletter subscription item
|
||||
Route::post('subscribers/delete/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@destroy')->name('admin.customers.subscribers.delete');
|
||||
|
||||
Route::get('subscribers/edit/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@edit')->defaults('_config', [
|
||||
'view' => 'admin::marketing.email-marketing.subscribers.edit',
|
||||
])->name('admin.customers.subscribers.edit');
|
||||
|
||||
Route::put('subscribers/update/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@update')->defaults('_config', [
|
||||
'redirect' => 'admin.customers.subscribers.index',
|
||||
])->name('admin.customers.subscribers.update');
|
||||
});
|
||||
|
||||
Route::prefix('cms')->group(function () {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,11 @@ return [
|
|||
'tax-categories' => 'فئات الضرائب',
|
||||
'tax-rates' => 'المعدلات الضريبية',
|
||||
'refunds' => 'المبالغ المستردة',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'الترقيات',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'خصم',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -111,6 +115,7 @@ return [
|
|||
'edit' => 'تعديل',
|
||||
'create' => 'أضف',
|
||||
'delete' => 'حذف',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'الترقيات',
|
||||
'cart-rules' => 'قواعد سلة التسوق',
|
||||
'catalog-rules' => 'قواعد الكتالوج',
|
||||
|
|
@ -1128,6 +1133,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'إذهب إلى البيت',
|
||||
'in-maitainace' => 'في الصيانة',
|
||||
|
|
|
|||
|
|
@ -72,9 +72,13 @@ return [
|
|||
'roles' => 'Rollen',
|
||||
'sliders' => 'Slider',
|
||||
'taxes' => 'Steuern',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promotions',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'tax-categories' => 'Steuer-Kategorien',
|
||||
'tax-rates' => 'Steuersätze',
|
||||
'promotions' => 'Promotions',
|
||||
'discount' => 'Rabatt',
|
||||
'cms' => 'CMS',
|
||||
],
|
||||
|
|
@ -110,6 +114,7 @@ return [
|
|||
'edit' => 'Bearbeiten',
|
||||
'create' => 'Hinzufügen',
|
||||
'delete' => 'Löschen',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promotions',
|
||||
'cart-rules' => 'Warenkorbregeln',
|
||||
'catalog-rules' => 'Katalogregeln',
|
||||
|
|
@ -1127,6 +1132,69 @@ return [
|
|||
'attribute_family' => 'Attributgruppe',
|
||||
],
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' =>
|
||||
[
|
||||
'go-to-home' => 'HOME ÖFFNEN',
|
||||
|
|
|
|||
|
|
@ -75,7 +75,12 @@ return [
|
|||
'taxes' => 'Taxes',
|
||||
'tax-categories' => 'Tax Categories',
|
||||
'tax-rates' => 'Tax Rates',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promotions',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'events' => 'Events',
|
||||
'discount' => 'Discount',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -111,9 +116,15 @@ return [
|
|||
'edit' => 'Edit',
|
||||
'create' => 'Add',
|
||||
'delete' => 'Delete',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promotions',
|
||||
'cart-rules' => 'Cart Rules',
|
||||
'catalog-rules' => 'Catalog Rules',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'email-templates' => 'Email Templates',
|
||||
'campaigns' => 'Campaigns',
|
||||
'subscribers' => 'Newsletter Subscribers',
|
||||
'events' => 'Events'
|
||||
],
|
||||
|
||||
'dashboard' => [
|
||||
|
|
@ -213,6 +224,7 @@ return [
|
|||
'end' => 'End',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'true' => 'True',
|
||||
'false' => 'False',
|
||||
'approved' => 'Approved',
|
||||
|
|
@ -227,7 +239,9 @@ return [
|
|||
'view' => 'View',
|
||||
'rtl' => 'RTL',
|
||||
'ltr' => 'LTR',
|
||||
'update-status' => 'Update Status'
|
||||
'update-status' => 'Update Status',
|
||||
'subject' => 'Subject',
|
||||
'date' => 'Date'
|
||||
],
|
||||
|
||||
'account' => [
|
||||
|
|
@ -979,8 +993,8 @@ return [
|
|||
],
|
||||
|
||||
'subscribers' => [
|
||||
'title' => 'News Letter Subscribers',
|
||||
'title-edit' => 'Edit News Letter Subscriber',
|
||||
'title' => 'Newsletter Subscribers',
|
||||
'title-edit' => 'Edit Newsletter Subscriber',
|
||||
'email' => 'Email',
|
||||
'is_subscribed' => 'Subscribed',
|
||||
'edit-btn-title' => 'Update Subscriber',
|
||||
|
|
@ -1127,6 +1141,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'GO TO HOME',
|
||||
'in-maitainace' => 'In Maintenance',
|
||||
|
|
@ -1299,8 +1375,8 @@ return [
|
|||
'money-transfer' => 'Money Transfer',
|
||||
'paypal-standard' => 'PayPal Standard',
|
||||
'business-account' => 'Business Account',
|
||||
'newsletter' => 'NewsLetter Subscription',
|
||||
'newsletter-subscription' => 'Allow NewsLetter Subscription',
|
||||
'newsletter' => 'Newsletter Subscription',
|
||||
'newsletter-subscription' => 'Allow Newsletter Subscription',
|
||||
'email' => 'Email Verification',
|
||||
'email-verification' => 'Allow Email Verification',
|
||||
'sort_order' => 'Sort Order',
|
||||
|
|
|
|||
|
|
@ -73,7 +73,11 @@ return [
|
|||
'taxes' => 'Impuestos',
|
||||
'tax-categories' => 'Categorías de impuestos',
|
||||
'tax-rates' => 'Tasas de impuestos',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promociones',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'Descuento',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -109,6 +113,7 @@ return [
|
|||
'edit' => 'Editar',
|
||||
'create' => 'Agregar',
|
||||
'delete' => 'Borrar',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promociones',
|
||||
'cart-rules' => 'Reglas del carrito',
|
||||
'catalog-rules' => 'Reglas del catálogo',
|
||||
|
|
@ -1120,6 +1125,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'REGRESAR AL INICIO',
|
||||
'in-maitainace' => 'En mantenimiento',
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ return [
|
|||
'taxes' => 'مالیات',
|
||||
'tax-categories' => 'دسته بندی مالیات',
|
||||
'tax-rates' => 'نرخ مالیات',
|
||||
'promotion' => 'تبلیغات',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'تبلیغات',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'تخفیف',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -110,7 +114,8 @@ return [
|
|||
'edit' => 'ویاریش',
|
||||
'create' => 'افزودن',
|
||||
'delete' => 'حذف',
|
||||
'promotion' => 'تبلیغات',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'تبلیغات',
|
||||
'cart-rules' => 'قوانین سبد خرید',
|
||||
'catalog-rules' => 'قوانین فهرست',
|
||||
],
|
||||
|
|
@ -990,7 +995,7 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'promotion' => [
|
||||
'promotions' => [
|
||||
'cart-rules' => [
|
||||
'title' => 'قوانین سبد خرید',
|
||||
'add-title' => 'قانون سبد خرید را اضافه کنید',
|
||||
|
|
@ -1126,6 +1131,70 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'رفتن به خانه',
|
||||
'in-maitainace' => 'در حال تعمیر و نگهداری',
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ return [
|
|||
'taxes' => 'IVA',
|
||||
'tax-categories' => 'Categorie IVA',
|
||||
'tax-rates' => 'Aliquote IVA',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promozioni',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'Sconti',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -110,6 +114,7 @@ return [
|
|||
'edit' => 'Modifica',
|
||||
'create' => 'Aggiungi',
|
||||
'delete' => 'Elimina',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promozioni',
|
||||
'cart-rules' => 'Regole Carrello',
|
||||
'catalog-rules' => 'Regole Catalogo',
|
||||
|
|
@ -1131,6 +1136,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'TORNA A HOME',
|
||||
'in-maitainace' => 'In Manutezione',
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ return [
|
|||
'taxes' => 'BTW',
|
||||
'tax-categories' => 'BTW-groepen',
|
||||
'tax-rates' => 'BTW-tarieven',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promoties',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'Korting',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -110,6 +114,7 @@ return [
|
|||
'edit' => 'Edit',
|
||||
'create' => 'Add',
|
||||
'delete' => 'Verwijder',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promoties',
|
||||
'cart-rules' => 'Cart Rules',
|
||||
'catalog-rules' => 'Catalog Rules',
|
||||
|
|
@ -1127,6 +1132,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'GA NAAR HUIS',
|
||||
'in-maitainace' => 'In onderhoud',
|
||||
|
|
|
|||
|
|
@ -73,7 +73,11 @@ return [
|
|||
'taxes' => 'Podatki',
|
||||
'tax-categories' => 'Kategorie podatkowe',
|
||||
'tax-rates' => 'Stawki podatkowe',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promocje',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'Rabat',
|
||||
'cms' => 'System CMS'
|
||||
],
|
||||
|
|
@ -109,6 +113,7 @@ return [
|
|||
'edit' => 'Edytuj',
|
||||
'create' => 'Dodaj',
|
||||
'delete' => 'Usuń',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promocje',
|
||||
'cart-rules' => 'Zasady koszyka',
|
||||
'catalog-rules' => 'Zasady katalogu',
|
||||
|
|
@ -1128,6 +1133,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'IDŹ DO GŁÓWNEJ',
|
||||
'in-maitainace' => 'W konserwacji',
|
||||
|
|
|
|||
|
|
@ -74,7 +74,11 @@ return [
|
|||
'taxes' => 'Impostos',
|
||||
'tax-categories' => 'Categorias de Impostos',
|
||||
'tax-rates' => 'Impostos de Impostos',
|
||||
'promotion' => 'Promoções',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promoções',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'Desconto',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -110,6 +114,7 @@ return [
|
|||
'edit' => 'Edit',
|
||||
'create' => 'Add',
|
||||
'delete' => 'Delete',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promoções',
|
||||
'cart-rules' => 'Regras do Carrinho',
|
||||
'catalog-rules' => 'Regras do Catálogo',
|
||||
|
|
@ -991,7 +996,7 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'promotion' => [
|
||||
'promotions' => [
|
||||
'cart-rules' => [
|
||||
'title' => 'Regras do carrinho',
|
||||
'add-title' => 'Adicionar regra de carrinho',
|
||||
|
|
@ -1127,6 +1132,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'IR PARA PÁGINA INICIAL',
|
||||
'in-maitainace' => 'Em manutenção',
|
||||
|
|
|
|||
|
|
@ -72,7 +72,11 @@ return [
|
|||
'taxes' => 'Vergiler',
|
||||
'tax-categories' => 'Vergi Kategorileri',
|
||||
'tax-rates' => 'Vergi Oranları',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promosyon',
|
||||
'email-marketing' => 'Email Marketing',
|
||||
'campaigns' => 'Campaigns',
|
||||
'email-templates' => 'Email Templates',
|
||||
'discount' => 'İndirim',
|
||||
'cms' => 'CMS'
|
||||
],
|
||||
|
|
@ -108,6 +112,7 @@ return [
|
|||
'edit' => 'Düzenle',
|
||||
'create' => 'Oluştur',
|
||||
'delete' => 'Sil',
|
||||
'marketing' => 'Marketing',
|
||||
'promotions' => 'Promosyonlar',
|
||||
'cart-rules' => 'Alışveriş Sepeti Kuralları',
|
||||
'catalog-rules' => 'Katalog Kuralları',
|
||||
|
|
@ -1115,6 +1120,68 @@ return [
|
|||
]
|
||||
],
|
||||
|
||||
'marketing' => [
|
||||
'templates' => [
|
||||
'title' => 'Email Templates',
|
||||
'add-title' => 'Add Email Template',
|
||||
'edit-title' => 'Edit Email Template',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'draft' => 'Draft',
|
||||
'content' => 'Content',
|
||||
'create-success' => 'Email template created successfully.',
|
||||
'update-success' => 'Email template updated successfully.',
|
||||
'delete-success' => 'Email template deleted successfully',
|
||||
],
|
||||
|
||||
'campaigns' => [
|
||||
'title' => 'Campaigns',
|
||||
'add-title' => 'Add Campaign',
|
||||
'edit-title' => 'Edit Campaign',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'status' => 'Status',
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'subject' => 'Subject',
|
||||
'email-template' => 'Email Template',
|
||||
'audience' => 'Audience',
|
||||
'channel' => 'Channel',
|
||||
'customer-group' => 'Customer Group',
|
||||
'schedule' => 'Schedule',
|
||||
'schedule-type' => 'Schedule Type',
|
||||
'once' => 'Once',
|
||||
'events' => 'Events',
|
||||
'schedule-date' => 'Schedule Date',
|
||||
'spooling' => 'Spooling',
|
||||
'event' => 'Event',
|
||||
'birthday' => 'Birthday',
|
||||
'create-success' => 'Campaign created successfully.',
|
||||
'update-success' => 'Campaign updated successfully.',
|
||||
'delete-success' => 'Campaign deleted successfully',
|
||||
],
|
||||
|
||||
'events' => [
|
||||
'title' => 'Events',
|
||||
'add-title' => 'Add Event',
|
||||
'edit-title' => 'Edit Event',
|
||||
'save-btn-title' => 'Save',
|
||||
'general' => 'General',
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'date' => 'Date',
|
||||
'create-success' => 'Event created successfully.',
|
||||
'update-success' => 'Event updated successfully.',
|
||||
'delete-success' => 'Event deleted successfully.',
|
||||
'edit-error' => 'Can not edit this event.'
|
||||
]
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'go-to-home' => 'ANA SAYFAYA GİT',
|
||||
'in-maitainace' => 'Bakım Modunda',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,124 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.campaigns.add-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.campaigns.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.campaigns.add-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.campaigns.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.campaigns.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.campaigns.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as=""{{ __('admin::app.marketing.campaigns.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('subject') ? 'has-error' : '']">
|
||||
<label for="subject" class="required">{{ __('admin::app.marketing.campaigns.subject') }}</label>
|
||||
<input v-validate="'required'" class="control" id="subject" name="subject" value="{{ old('subject') }}" data-vv-as=""{{ __('admin::app.marketing.campaigns.subject') }}""/>
|
||||
<span class="control-error" v-if="errors.has('subject')">@{{ errors.first('subject') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('marketing_event_id') ? 'has-error' : '']">
|
||||
<label for="event" class="required">{{ __('admin::app.marketing.campaigns.event') }}</label>
|
||||
<select class="control" v-validate="'required'" id="marketing_event_id" name="marketing_event_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.event') }}"">
|
||||
@foreach (app('Webkul\Marketing\Repositories\EventRepository')->all() as $event)
|
||||
<option value="{{ $event->id }}" {{ old('marketing_event_id') == $event->id ? 'selected' : '' }}>
|
||||
{{ $event->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('marketing_event_id')">@{{ errors.first('marketing_event_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('marketing_template_id') ? 'has-error' : '']">
|
||||
<label for="marketing_template_id" class="required">{{ __('admin::app.marketing.campaigns.email-template') }}</label>
|
||||
<select v-validate="'required'" class="control" id="marketing_template_id" name="marketing_template_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.email-template') }}"">
|
||||
@foreach (app('Webkul\Marketing\Repositories\TemplateRepository')->all() as $template)
|
||||
<option value="{{ $template->id }}" {{ old('marketing_template_id') == $template->id ? 'selected' : '' }}>
|
||||
{{ $template->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('marketing_template_id')">@{{ errors.first('marketing_template_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||
<label for="status" class="required">{{ __('admin::app.marketing.campaigns.status') }}</label>
|
||||
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as=""{{ __('admin::app.marketing.campaigns.display-mode') }}"">
|
||||
<option value="0" {{ old('status') == 0 ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.campaigns.inactive') }}
|
||||
</option>
|
||||
<option value="1" {{ old('status') == 1 ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.campaigns.active') }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.campaigns.audience') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
|
||||
<label for="channel_id" class="required">{{ __('admin::app.marketing.campaigns.channel') }}</label>
|
||||
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.channel') }}"">
|
||||
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
|
||||
<option value="{{ $channel->id }}" {{ old('channel_id') == $channel->id ? 'selected' : '' }}>
|
||||
{{ $channel->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('customer_group_id') ? 'has-error' : '']">
|
||||
<label for="customer_group_id" class="required">{{ __('admin::app.marketing.campaigns.customer-group') }}</label>
|
||||
<select v-validate="'required'" class="control" id="customer_group_id" name="customer_group_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.customer-group') }}"">
|
||||
@foreach (app('Webkul\Customer\Repositories\CustomerGroupRepository')->all() as $customerGroup)
|
||||
<option value="{{ $customerGroup->id }}" {{ old('customer_group_id') == $customerGroup->id ? 'selected' : '' }}>
|
||||
{{ $customerGroup->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('customer_group_id')">@{{ errors.first('customer_group_id') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.campaigns.edit-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.campaigns.update', $campaign->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.campaigns.edit-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.campaigns.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.campaigns.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.campaigns.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $campaign->name }}" data-vv-as=""{{ __('admin::app.marketing.campaigns.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('subject') ? 'has-error' : '']">
|
||||
<label for="subject" class="required">{{ __('admin::app.marketing.campaigns.subject') }}</label>
|
||||
<input v-validate="'required'" class="control" id="subject" name="subject" value="{{ old('subject') ?: $campaign->subject }}" data-vv-as=""{{ __('admin::app.marketing.campaigns.subject') }}""/>
|
||||
<span class="control-error" v-if="errors.has('subject')">@{{ errors.first('subject') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('marketing_event_id') ? 'has-error' : '']">
|
||||
<label for="marketing_event_id" class="required">{{ __('admin::app.marketing.campaigns.event') }}</label>
|
||||
<?php $selectedOption = old('marketing_event_id') ?: $campaign->marketing_event_id ?>
|
||||
<select class="control" v-validate="'required'" id="marketing_event_id" name="marketing_event_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.event') }}"">
|
||||
@foreach (app('Webkul\Marketing\Repositories\EventRepository')->all() as $event)
|
||||
<option value="{{ $event->id }}" {{ $selectedOption == $event->id ? 'selected' : '' }}>
|
||||
{{ $event->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('marketing_event_id')">@{{ errors.first('marketing_event_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('marketing_template_id') ? 'has-error' : '']">
|
||||
<label for="marketing_template_id" class="required">{{ __('admin::app.marketing.campaigns.email-template') }}</label>
|
||||
<?php $selectedOption = old('marketing_template_id') ?: $campaign->marketing_template_id ?>
|
||||
<select v-validate="'required'" class="control" id="marketing_template_id" name="marketing_template_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.email-template') }}"">
|
||||
@foreach (app('Webkul\Marketing\Repositories\TemplateRepository')->all() as $template)
|
||||
<option value="{{ $template->id }}" {{ $selectedOption == $template->id ? 'selected' : '' }}>
|
||||
{{ $template->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('marketing_template_id')">@{{ errors.first('marketing_template_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||
<label for="status" class="required">{{ __('admin::app.marketing.campaigns.status') }}</label>
|
||||
<?php $selectedOption = old('status') ?: $campaign->status ?>
|
||||
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as=""{{ __('admin::app.marketing.campaigns.display-mode') }}"">
|
||||
<option value="0" {{ $selectedOption == 0 ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.campaigns.inactive') }}
|
||||
</option>
|
||||
<option value="1" {{ $selectedOption == 1 ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.campaigns.active') }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.campaigns.audience') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
|
||||
<label for="channel_id" class="required">{{ __('admin::app.marketing.campaigns.channel') }}</label>
|
||||
<?php $selectedOption = old('channel_id') ?: $campaign->channel_id ?>
|
||||
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.channel') }}"">
|
||||
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
|
||||
<option value="{{ $channel->id }}" {{ $selectedOption == $channel->id ? 'selected' : '' }}>
|
||||
{{ $channel->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('customer_group_id') ? 'has-error' : '']">
|
||||
<label for="customer_group_id" class="required">{{ __('admin::app.marketing.campaigns.customer-group') }}</label>
|
||||
<?php $selectedOption = old('customer_group_id') ?: $campaign->customer_group_id ?>
|
||||
<select v-validate="'required'" class="control" id="customer_group_id" name="customer_group_id" data-vv-as=""{{ __('admin::app.marketing.campaigns.customer-group') }}"">
|
||||
@foreach (app('Webkul\Customer\Repositories\CustomerGroupRepository')->all() as $customerGroup)
|
||||
<option value="{{ $customerGroup->id }}" {{ $selectedOption == $customerGroup->id ? 'selected' : '' }}>
|
||||
{{ $customerGroup->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('customer_group_id')">@{{ errors.first('customer_group_id') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.campaigns.title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.marketing.campaigns.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.campaigns.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.campaigns.add-title') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\CampaignDataGrid')->render() !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.events.add-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.events.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.events.add-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.events.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.events.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.events.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.events.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as=""{{ __('admin::app.marketing.events.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
|
||||
<label for="description" class="required">{{ __('admin::app.marketing.events.description') }}</label>
|
||||
<textarea v-validate="'required'" class="control" id="description" name="description" data-vv-as=""{{ __('admin::app.marketing.events.description') }}"">{{ old('description') }}</textarea>
|
||||
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('date') ? 'has-error' : '']">
|
||||
<label for="date" class="required">{{ __('admin::app.marketing.events.date') }}</label>
|
||||
<date>
|
||||
<input type="text" name="date" class="control" v-validate="'required'" value="{{ old('date') }}" data-vv-as=""{{ __('admin::app.marketing.events.date') }}"">
|
||||
</date>
|
||||
<span class="control-error" v-if="errors.has('date')">@{{ errors.first('date') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.events.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.events.edit-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.events.update', $event->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.events.edit-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.events.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.events.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.events.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.events.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $event->name }}" data-vv-as=""{{ __('admin::app.marketing.events.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
|
||||
<label for="description" class="required">{{ __('admin::app.marketing.events.description') }}</label>
|
||||
<textarea v-validate="'required'" class="control" id="description" name="description" data-vv-as=""{{ __('admin::app.marketing.events.description') }}"">{{ old('description') ?: $event->description }}</textarea>
|
||||
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('date') ? 'has-error' : '']">
|
||||
<label for="date" class="required">{{ __('admin::app.marketing.events.date') }}</label>
|
||||
<date>
|
||||
<input type="text" name="date" class="control" v-validate="'required'" value="{{ old('date') ?: $event->date }}" data-vv-as=""{{ __('admin::app.marketing.events.date') }}"">
|
||||
</date>
|
||||
<span class="control-error" v-if="errors.has('date')">@{{ errors.first('date') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.events.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.events.title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.marketing.events.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.events.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.events.add-title') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\EventDataGrid')->render() !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.templates.add-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.email-templates.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.templates.add-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.templates.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.templates.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.templates.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as=""{{ __('admin::app.marketing.templates.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||
<label for="status" class="required">{{ __('admin::app.marketing.templates.status') }}</label>
|
||||
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as=""{{ __('admin::app.marketing.templates.display-mode') }}"">
|
||||
<option value="active" {{ old('status') == 'active' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.active') }}
|
||||
</option>
|
||||
<option value="inactive" {{ old('status') == 'inactive' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.inactive') }}
|
||||
</option>
|
||||
<option value="draft" {{ old('status') == 'draft' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.draft') }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
|
||||
<label for="content" class="required">{{ __('admin::app.marketing.templates.content') }}</label>
|
||||
<textarea v-validate="'required'" class="control" id="content" name="content" data-vv-as=""{{ __('admin::app.marketing.templates.content') }}"">{{ old('content') }}</textarea>
|
||||
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
tinymce.init({
|
||||
selector: 'textarea#content',
|
||||
height: 200,
|
||||
width: "100%",
|
||||
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor link hr | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code | table',
|
||||
image_advtab: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.templates.edit-title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
|
||||
<form method="POST" action="{{ route('admin.email-templates.update', $template->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>
|
||||
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
|
||||
|
||||
{{ __('admin::app.marketing.templates.edit-title') }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<button type="submit" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.templates.save-btn-title') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="form-container">
|
||||
@csrf()
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
|
||||
|
||||
<accordian :title="'{{ __('admin::app.marketing.templates.general') }}'" :active="true">
|
||||
<div slot="body">
|
||||
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
|
||||
<label for="name" class="required">{{ __('admin::app.marketing.templates.name') }}</label>
|
||||
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $template->name }}" data-vv-as=""{{ __('admin::app.marketing.templates.name') }}""/>
|
||||
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
|
||||
<label for="status" class="required">{{ __('admin::app.marketing.templates.status') }}</label>
|
||||
<?php $selectedOption = old('status') ?: $template->status ?>
|
||||
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as=""{{ __('admin::app.marketing.templates.display-mode') }}"">
|
||||
<option value="active" {{ $selectedOption == 'active' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.active') }}
|
||||
</option>
|
||||
<option value="inactive" {{ $selectedOption == 'inactive' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.inactive') }}
|
||||
</option>
|
||||
<option value="draft" {{ $selectedOption == 'draft' ? 'selected' : '' }}>
|
||||
{{ __('admin::app.marketing.templates.draft') }}
|
||||
</option>
|
||||
</select>
|
||||
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
|
||||
<label for="content" class="required">{{ __('admin::app.marketing.templates.content') }}</label>
|
||||
<textarea v-validate="'required'" class="control" id="content" name="content" data-vv-as=""{{ __('admin::app.marketing.templates.content') }}"">{{ old('content') ?: $template->content }}</textarea>
|
||||
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</accordian>
|
||||
|
||||
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
tinymce.init({
|
||||
selector: 'textarea#content',
|
||||
height: 200,
|
||||
width: "100%",
|
||||
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor link hr | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code | table',
|
||||
image_advtab: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
@extends('admin::layouts.content')
|
||||
|
||||
@section('page_title')
|
||||
{{ __('admin::app.marketing.templates.title') }}
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="page-header">
|
||||
<div class="page-title">
|
||||
<h1>{{ __('admin::app.marketing.templates.title') }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="page-action">
|
||||
<a href="{{ route('admin.email-templates.create') }}" class="btn btn-lg btn-primary">
|
||||
{{ __('admin::app.marketing.templates.add-title') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
{!! app('Webkul\Admin\DataGrids\EmailTemplateDataGrid')->render() !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
@ -24,6 +24,7 @@ return [
|
|||
\Webkul\CMS\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Customer\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Inventory\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Marketing\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Payment\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Paypal\Providers\ModuleServiceProvider::class,
|
||||
\Webkul\Product\Providers\ModuleServiceProvider::class,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddCustomerIdColumnInSubscribersListTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('subscribers_list', function (Blueprint $table) {
|
||||
$table->integer('customer_id')->unsigned()->nullable();
|
||||
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('subscribers_list', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@ class SubscribersList extends Model implements SubscribersListContract
|
|||
'email',
|
||||
'is_subscribed',
|
||||
'token',
|
||||
'customer_id',
|
||||
'channel_id',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@ namespace Webkul\Customer\Http\Controllers;
|
|||
|
||||
use Hash;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\Shop\Mail\SubscriptionEmail;
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
use Webkul\Product\Repositories\ProductReviewRepository;
|
||||
use Webkul\Core\Repositories\SubscribersListRepository;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
|
|
@ -30,16 +33,25 @@ class CustomerController extends Controller
|
|||
*/
|
||||
protected $productReviewRepository;
|
||||
|
||||
/**
|
||||
* SubscribersListRepository
|
||||
*
|
||||
* @var \Webkul\Core\Repositories\SubscribersListRepository
|
||||
*/
|
||||
protected $subscriptionRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository
|
||||
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReviewRepository
|
||||
* @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
CustomerRepository $customerRepository,
|
||||
ProductReviewRepository $productReviewRepository
|
||||
ProductReviewRepository $productReviewRepository,
|
||||
SubscribersListRepository $subscriptionRepository
|
||||
)
|
||||
{
|
||||
$this->middleware('customer');
|
||||
|
|
@ -49,6 +61,8 @@ class CustomerController extends Controller
|
|||
$this->customerRepository = $customerRepository;
|
||||
|
||||
$this->productReviewRepository = $productReviewRepository;
|
||||
|
||||
$this->subscriptionRepository = $subscriptionRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,10 +116,13 @@ class CustomerController extends Controller
|
|||
unset($data['date_of_birth']);
|
||||
}
|
||||
|
||||
$data['subscribed_to_news_letter'] = isset($data['subscribed_to_news_letter']) ? 1 : 0;
|
||||
|
||||
if (isset ($data['oldpassword'])) {
|
||||
if ($data['oldpassword'] != "" || $data['oldpassword'] != null) {
|
||||
if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) {
|
||||
$isPasswordChanged = true;
|
||||
|
||||
$data['password'] = bcrypt($data['password']);
|
||||
} else {
|
||||
session()->flash('warning', trans('shop::app.customer.account.profile.unmatch'));
|
||||
|
|
@ -120,13 +137,47 @@ class CustomerController extends Controller
|
|||
Event::dispatch('customer.update.before');
|
||||
|
||||
if ($customer = $this->customerRepository->update($data, $id)) {
|
||||
|
||||
if ($isPasswordChanged) {
|
||||
Event::dispatch('user.admin.update-password', $customer);
|
||||
}
|
||||
|
||||
Event::dispatch('customer.update.after', $customer);
|
||||
|
||||
if ($data['subscribed_to_news_letter']) {
|
||||
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
|
||||
|
||||
if ($subscription) {
|
||||
$this->subscriptionRepository->update([
|
||||
'customer_id' => $customer->id,
|
||||
'is_subscribed' => 1,
|
||||
], $subscription->id);
|
||||
} else {
|
||||
$this->subscriptionRepository->create([
|
||||
'email' => $data['email'],
|
||||
'customer_id' => $customer->id,
|
||||
'channel_id' => core()->getCurrentChannel()->id,
|
||||
'is_subscribed' => 1,
|
||||
'token' => $token = uniqid(),
|
||||
]);
|
||||
|
||||
try {
|
||||
Mail::queue(new SubscriptionEmail([
|
||||
'email' => $data['email'],
|
||||
'token' => $token,
|
||||
]));
|
||||
} catch (\Exception $e) { }
|
||||
}
|
||||
} else {
|
||||
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
|
||||
|
||||
if ($subscription) {
|
||||
$this->subscriptionRepository->update([
|
||||
'customer_id' => $customer->id,
|
||||
'is_subscribed' => 0,
|
||||
], $subscription->id);
|
||||
}
|
||||
}
|
||||
|
||||
Session()->flash('success', trans('shop::app.customer.account.profile.edit-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
namespace Webkul\Customer\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\Customer\Mail\RegistrationEmail;
|
||||
use Webkul\Customer\Mail\VerificationEmail;
|
||||
use Webkul\Shop\Mail\SubscriptionEmail;
|
||||
use Webkul\Customer\Repositories\CustomerRepository;
|
||||
use Webkul\Customer\Repositories\CustomerGroupRepository;
|
||||
use Webkul\Core\Repositories\SubscribersListRepository;
|
||||
use Cookie;
|
||||
|
||||
class RegistrationController extends Controller
|
||||
|
|
@ -35,17 +36,26 @@ class RegistrationController extends Controller
|
|||
*/
|
||||
protected $customerGroupRepository;
|
||||
|
||||
/**
|
||||
* SubscribersListRepository
|
||||
*
|
||||
* @var \Webkul\Core\Repositories\SubscribersListRepository
|
||||
*/
|
||||
protected $subscriptionRepository;
|
||||
|
||||
/**
|
||||
* Create a new Repository instance.
|
||||
*
|
||||
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
|
||||
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
|
||||
*
|
||||
* @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
CustomerRepository $customerRepository,
|
||||
CustomerGroupRepository $customerGroupRepository
|
||||
CustomerGroupRepository $customerGroupRepository,
|
||||
SubscribersListRepository $subscriptionRepository
|
||||
)
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
|
|
@ -53,6 +63,8 @@ class RegistrationController extends Controller
|
|||
$this->customerRepository = $customerRepository;
|
||||
|
||||
$this->customerGroupRepository = $customerGroupRepository;
|
||||
|
||||
$this->subscriptionRepository = $subscriptionRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -79,22 +91,13 @@ class RegistrationController extends Controller
|
|||
'password' => 'confirmed|min:6|required',
|
||||
]);
|
||||
|
||||
$data = request()->input();
|
||||
|
||||
$data['password'] = bcrypt($data['password']);
|
||||
$data['api_token'] = Str::random(80);
|
||||
|
||||
if (core()->getConfigData('customer.settings.email.verification')) {
|
||||
$data['is_verified'] = 0;
|
||||
} else {
|
||||
$data['is_verified'] = 1;
|
||||
}
|
||||
|
||||
$data['customer_group_id'] = $this->customerGroupRepository->findOneWhere(['code' => 'general'])->id;
|
||||
|
||||
$verificationData['email'] = $data['email'];
|
||||
$verificationData['token'] = md5(uniqid(rand(), true));
|
||||
$data['token'] = $verificationData['token'];
|
||||
$data = array_merge(request()->input(), [
|
||||
'password' => bcrypt(request()->input('password')),
|
||||
'api_token' => Str::random(80),
|
||||
'is_verified' => core()->getConfigData('customer.settings.email.verification') ? 0 : 1,
|
||||
'customer_group_id' => $this->customerGroupRepository->findOneWhere(['code' => 'general'])->id,
|
||||
'token' => md5(uniqid(rand(), true)),
|
||||
]);
|
||||
|
||||
Event::dispatch('customer.registration.before');
|
||||
|
||||
|
|
@ -102,41 +105,66 @@ class RegistrationController extends Controller
|
|||
|
||||
Event::dispatch('customer.registration.after', $customer);
|
||||
|
||||
if ($customer) {
|
||||
if (core()->getConfigData('customer.settings.email.verification')) {
|
||||
try {
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.verification';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new VerificationEmail($verificationData));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
$configKey = 'emails.general.notifications.emails.general.notifications.registration';
|
||||
if (core()->getConfigData($configKey)) {
|
||||
Mail::queue(new RegistrationEmail(request()->all()));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); //customer registered successfully
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success'));
|
||||
}
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
} else {
|
||||
if (! $customer) {
|
||||
session()->flash('error', trans('shop::app.customer.signup-form.failed'));
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
if (isset($data['is_subscribed'])) {
|
||||
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
|
||||
|
||||
if ($subscription) {
|
||||
$this->subscriptionRepository->update([
|
||||
'customer_id' => $customer->id,
|
||||
], $subscription->id);
|
||||
} else {
|
||||
$this->subscriptionRepository->create([
|
||||
'email' => $data['email'],
|
||||
'customer_id' => $customer->id,
|
||||
'channel_id' => core()->getCurrentChannel()->id,
|
||||
'is_subscribed' => 1,
|
||||
'token' => $token = uniqid(),
|
||||
]);
|
||||
|
||||
try {
|
||||
Mail::queue(new SubscriptionEmail([
|
||||
'email' => $data['email'],
|
||||
'token' => $token,
|
||||
]));
|
||||
} catch (\Exception $e) { }
|
||||
}
|
||||
}
|
||||
|
||||
if (core()->getConfigData('customer.settings.email.verification')) {
|
||||
try {
|
||||
if (core()->getConfigData('emails.general.notifications.emails.general.notifications.verification')) {
|
||||
Mail::queue(new VerificationEmail(['email' => $data['email'], 'token' => $data['token']]));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (core()->getConfigData('emails.general.notifications.emails.general.notifications.registration')) {
|
||||
Mail::queue(new RegistrationEmail(request()->all()));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
|
||||
}
|
||||
|
||||
session()->flash('success', trans('shop::app.customer.signup-form.success'));
|
||||
}
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -166,8 +194,10 @@ class RegistrationController extends Controller
|
|||
*/
|
||||
public function resendVerificationEmail($email)
|
||||
{
|
||||
$verificationData['email'] = $email;
|
||||
$verificationData['token'] = md5(uniqid(rand(), true));
|
||||
$verificationData = [
|
||||
'email' => $email,
|
||||
'token' => md5(uniqid(rand(), true)),
|
||||
];
|
||||
|
||||
$customer = $this->customerRepository->findOneByField('email', $email);
|
||||
|
||||
|
|
@ -185,6 +215,7 @@ class RegistrationController extends Controller
|
|||
}
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
|
||||
session()->flash('error', trans('shop::app.customer.signup-form.verification-not-sent'));
|
||||
|
||||
return redirect()->back();
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ class CustomerGroup extends Model implements CustomerGroupContract
|
|||
protected $fillable = ['name', 'code', 'is_user_defined'];
|
||||
|
||||
/**
|
||||
* Get the customer for this group.
|
||||
* Get the customers for this group.
|
||||
*/
|
||||
public function customer()
|
||||
public function customers()
|
||||
{
|
||||
return $this->hasMany(CustomerProxy::modelClass());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Webkul\Marketing\Helpers\Campaign;
|
||||
|
||||
class EmailsCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'campaign:process';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process campaigns and send emails to the subscribed customers.';
|
||||
|
||||
/**
|
||||
* Campaign object
|
||||
*
|
||||
* @var \Webkul\Marketing\Helpers\Campaign
|
||||
*/
|
||||
protected $campaignHelper;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @param \Webkul\Marketing\Repositories\Campaign $campaignHelper
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Campaign $campaignHelper)
|
||||
{
|
||||
$this->campaignHelper = $campaignHelper;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->campaignHelper->process();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Contracts;
|
||||
|
||||
interface Campaign
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Contracts;
|
||||
|
||||
interface Event
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Contracts;
|
||||
|
||||
interface Template
|
||||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMarketingTemplatesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('marketing_templates', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('status');
|
||||
$table->text('content');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marketing_templates');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMarketingEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('marketing_events', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->date('date')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
DB::table('marketing_events')->insert([
|
||||
'name' => 'Birthday',
|
||||
'description' => 'Birthday',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marketing_events');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateMarketingCampaignsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('marketing_campaigns', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('subject');
|
||||
$table->boolean('status')->default(0);
|
||||
$table->string('type');
|
||||
$table->string('mail_to');
|
||||
$table->string('spooling')->nullable();
|
||||
|
||||
$table->integer('channel_id')->unsigned()->nullable();
|
||||
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('set null');
|
||||
|
||||
$table->integer('customer_group_id')->unsigned()->nullable();
|
||||
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('set null');
|
||||
|
||||
$table->integer('marketing_template_id')->unsigned()->nullable();
|
||||
$table->foreign('marketing_template_id')->references('id')->on('marketing_templates')->onDelete('set null');
|
||||
|
||||
$table->integer('marketing_event_id')->unsigned()->nullable();
|
||||
$table->foreign('marketing_event_id')->references('id')->on('marketing_events')->onDelete('set null');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marketing_campaigns');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Helpers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Webkul\Marketing\Repositories\EventRepository;
|
||||
use Webkul\Marketing\Repositories\CampaignRepository;
|
||||
use Webkul\Marketing\Repositories\TemplateRepository;
|
||||
use Webkul\Marketing\Mail\NewsletterMail;
|
||||
|
||||
class Campaign
|
||||
{
|
||||
/**
|
||||
* EventRepository object
|
||||
*
|
||||
* @var \Webkul\Marketing\Repositories\EventRepository
|
||||
*/
|
||||
protected $eventRepository;
|
||||
|
||||
/**
|
||||
* CampaignRepository object
|
||||
*
|
||||
* @var \Webkul\Marketing\Repositories\CampaignRepository
|
||||
*/
|
||||
protected $campaignRepository;
|
||||
|
||||
/**
|
||||
* TemplateRepository object
|
||||
*
|
||||
* @var \Webkul\Marketing\Repositories\TemplateRepository
|
||||
*/
|
||||
protected $templateRepository;
|
||||
|
||||
/**
|
||||
* Create a new helper instance.
|
||||
*
|
||||
* @param \Webkul\Marketing\Repositories\EventRepository $eventRepository
|
||||
* @param \Webkul\Marketing\Repositories\CampaignRepository $campaignRepository
|
||||
* @param \Webkul\Marketing\Repositories\TemplateRepository $templateRepository
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
EventRepository $eventRepository,
|
||||
CampaignRepository $campaignRepository,
|
||||
CampaignRepository $templateRepository
|
||||
)
|
||||
{
|
||||
$this->eventRepository = $eventRepository;
|
||||
|
||||
$this->campaignRepository = $campaignRepository;
|
||||
|
||||
$this->templateRepository = $templateRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function process(): void
|
||||
{
|
||||
$campaigns = $this->campaignRepository->getModel()
|
||||
->leftJoin('marketing_events', 'marketing_campaigns.marketing_event_id', 'marketing_events.id')
|
||||
->select('marketing_campaigns.*')
|
||||
->where('status', 1)
|
||||
->where(function ($query) {
|
||||
$query->where('marketing_events.date', Carbon::now()->format('Y-m-d'))
|
||||
->orWhereNull('marketing_events.date');
|
||||
})
|
||||
->get();
|
||||
|
||||
foreach ($campaigns as $campaign) {
|
||||
if ($campaign->event->name == 'Birthday') {
|
||||
$emails = $this->getBirthdayEmails($campaign);
|
||||
} else {
|
||||
$emails = $this->getEmailAddresses($campaign);
|
||||
}
|
||||
|
||||
foreach ($emails as $email) {
|
||||
Mail::queue(new NewsletterMail($email, $campaign));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @param \Webkul\Marketing\Contracts\Campaign $campaign
|
||||
* @return array
|
||||
*/
|
||||
public function getEmailAddresses($campaign)
|
||||
{
|
||||
$newsletterEmails = app('\Webkul\Core\Repositories\SubscribersListRepository')->getModel()
|
||||
->where('is_subscribed', 1)
|
||||
->where('channel_id', $campaign->channel_id)
|
||||
->get('email');
|
||||
|
||||
$customerGroupEmails = $campaign->customer_group->customers()->where('subscribed_to_news_letter', 1)->get('email');
|
||||
|
||||
$emails = [];
|
||||
|
||||
foreach ($newsletterEmails as $row) {
|
||||
$emails[] = $row->email;
|
||||
}
|
||||
|
||||
foreach ($customerGroupEmails as $row) {
|
||||
$emails[] = $row->email;
|
||||
}
|
||||
|
||||
return array_unique($emails);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return customer's emails who has a birthday today
|
||||
*
|
||||
* @param \Webkul\Marketing\Contracts\Campaign $campaign
|
||||
* @return array
|
||||
*/
|
||||
public function getBirthdayEmails($campaign)
|
||||
{
|
||||
$customerGroupEmails = $campaign->customer_group->customers()
|
||||
->whereRaw('DATE_FORMAT(date_of_birth, "%m-%d") = ?', [Carbon::now()->format('m-d')])
|
||||
->where('subscribed_to_news_letter', 1)
|
||||
->get('email');
|
||||
|
||||
$emails = [];
|
||||
|
||||
foreach ($customerGroupEmails as $row) {
|
||||
$emails[] = $row->email;
|
||||
}
|
||||
|
||||
return $emails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Marketing\Repositories\CampaignRepository;
|
||||
|
||||
class CampaignController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* CampaignRepository object
|
||||
*
|
||||
* @var \Webkul\Core\Repositories\CampaignRepository
|
||||
*/
|
||||
protected $campaignRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Core\Repositories\CampaignRepository $campaignRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(CampaignRepository $campaignRepository)
|
||||
{
|
||||
$this->campaignRepository = $campaignRepository;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'subject' => 'required',
|
||||
'status' => 'required',
|
||||
'marketing_template_id' => 'required',
|
||||
'marketing_event_id' => 'required_if:schedule_type,event',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.campaigns.create.before');
|
||||
|
||||
$locale = $this->campaignRepository->create(request()->all());
|
||||
|
||||
Event::dispatch('marketing.campaigns.create.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.campaigns.create-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$campaign = $this->campaignRepository->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('campaign'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'subject' => 'required',
|
||||
'status' => 'required',
|
||||
'marketing_template_id' => 'required',
|
||||
'marketing_event_id' => 'required_if:schedule_type,event',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.campaigns.update.before', $id);
|
||||
|
||||
$locale = $this->campaignRepository->update(request()->all(), $id);
|
||||
|
||||
Event::dispatch('marketing.campaigns.update.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.campaigns.update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$locale = $this->campaignRepository->findOrFail($id);
|
||||
|
||||
try {
|
||||
Event::dispatch('marketing.campaigns.delete.before', $id);
|
||||
|
||||
$this->campaignRepository->delete($id);
|
||||
|
||||
Event::dispatch('marketing.campaigns.delete.after', $id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.campaigns.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Campaign']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Marketing\Repositories\EventRepository;
|
||||
|
||||
class EventController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* EventRepository object
|
||||
*
|
||||
* @var \Webkul\Marketing\Repositories\EventRepository
|
||||
*/
|
||||
protected $eventRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Marketing\Repositories\EventRepository $eventRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(EventRepository $eventRepository)
|
||||
{
|
||||
$this->eventRepository = $eventRepository;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'description' => 'required',
|
||||
'date' => 'date|required',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.events.create.before');
|
||||
|
||||
$locale = $this->eventRepository->create(request()->all());
|
||||
|
||||
Event::dispatch('marketing.events.create.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.events.create-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
if ($id == 1) {
|
||||
session()->flash('error', trans('admin::app.marketing.events.edit-error'));
|
||||
|
||||
return redirect()->back();
|
||||
} else {
|
||||
$event = $this->eventRepository->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('event'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'description' => 'required',
|
||||
'date' => 'date|required',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.events.update.before', $id);
|
||||
|
||||
$locale = $this->eventRepository->update(request()->all(), $id);
|
||||
|
||||
Event::dispatch('marketing.events.update.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.events.update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$locale = $this->eventRepository->findOrFail($id);
|
||||
|
||||
try {
|
||||
Event::dispatch('marketing.events.delete.before', $id);
|
||||
|
||||
$this->eventRepository->delete($id);
|
||||
|
||||
Event::dispatch('marketing.events.delete.after', $id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.events.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Event']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Marketing\Repositories\TemplateRepository;
|
||||
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
/**
|
||||
* Contains route related configuration
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* TemplateRepository object
|
||||
*
|
||||
* @var \Webkul\Core\Repositories\TemplateRepository
|
||||
*/
|
||||
protected $templateRepository;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Core\Repositories\TemplateRepository $templateRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(TemplateRepository $templateRepository)
|
||||
{
|
||||
$this->templateRepository = $templateRepository;
|
||||
|
||||
$this->_config = request('_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view($this->_config['view']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'status' => 'required|in:active,inactive,draft',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.templates.create.before');
|
||||
|
||||
$locale = $this->templateRepository->create(request()->all());
|
||||
|
||||
Event::dispatch('marketing.templates.create.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.templates.create-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$template = $this->templateRepository->findOrFail($id);
|
||||
|
||||
return view($this->_config['view'], compact('template'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update($id)
|
||||
{
|
||||
$this->validate(request(), [
|
||||
'name' => 'required',
|
||||
'status' => 'required|in:active,inactive,draft',
|
||||
'content' => 'required',
|
||||
]);
|
||||
|
||||
Event::dispatch('marketing.templates.update.before', $id);
|
||||
|
||||
$locale = $this->templateRepository->update(request()->all(), $id);
|
||||
|
||||
Event::dispatch('marketing.templates.update.after', $locale);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.templates.update-success'));
|
||||
|
||||
return redirect()->route($this->_config['redirect']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$locale = $this->templateRepository->findOrFail($id);
|
||||
|
||||
try {
|
||||
Event::dispatch('marketing.templates.delete.before', $id);
|
||||
|
||||
$this->templateRepository->delete($id);
|
||||
|
||||
Event::dispatch('marketing.templates.delete.after', $id);
|
||||
|
||||
session()->flash('success', trans('admin::app.marketing.templates.delete-success'));
|
||||
|
||||
return response()->json(['message' => true], 200);
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Template']));
|
||||
}
|
||||
|
||||
return response()->json(['message' => false], 400);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class NewsletterMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* The campaign instance.
|
||||
*
|
||||
* @var \Webkul\Marketing\Contracts\Campaign
|
||||
*/
|
||||
public $campaign;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*
|
||||
* @param string $email
|
||||
* @param \Webkul\Marketing\Contracts\Campaign $campaign
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($email, $campaign)
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
$this->campaign = $campaign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
|
||||
->to([$this->email])
|
||||
->subject($this->campaign->subject)
|
||||
->html($this->campaign->email_template->content);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Core\Models\ChannelProxy;
|
||||
use Webkul\Customer\Models\CustomerGroupProxy;
|
||||
use Webkul\Marketing\Contracts\Campaign as CampaignContract;
|
||||
|
||||
class Campaign extends Model implements CampaignContract
|
||||
{
|
||||
protected $table = 'marketing_campaigns';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'subject',
|
||||
'status',
|
||||
'channel_id',
|
||||
'customer_group_id',
|
||||
'marketing_template_id',
|
||||
'spooling',
|
||||
'marketing_event_id',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the event
|
||||
*/
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo(EventProxy::modelClass(), 'marketing_event_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channel
|
||||
*/
|
||||
public function channel()
|
||||
{
|
||||
return $this->belongsTo(ChannelProxy::modelClass(), 'channel_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the customer group
|
||||
*/
|
||||
public function customer_group()
|
||||
{
|
||||
return $this->belongsTo(CustomerGroupProxy::modelClass(), 'customer_group_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the email template
|
||||
*/
|
||||
public function email_template()
|
||||
{
|
||||
return $this->belongsTo(TemplateProxy::modelClass(), 'marketing_template_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class CampaignProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Marketing\Contracts\Event as EventContract;
|
||||
|
||||
class Event extends Model implements EventContract
|
||||
{
|
||||
protected $table = 'marketing_events';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'date',
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class EventProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Marketing\Contracts\Template as TemplateContract;
|
||||
|
||||
class Template extends Model implements TemplateContract
|
||||
{
|
||||
protected $table = 'marketing_templates';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'status',
|
||||
'content',
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Models;
|
||||
|
||||
use Konekt\Concord\Proxies\ModelProxy;
|
||||
|
||||
class TemplateProxy extends ModelProxy
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Webkul\Marketing\Console\Commands\EmailsCommand;
|
||||
|
||||
class MarketingServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
||||
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'marketing');
|
||||
|
||||
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'marketing');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([EmailsCommand::class]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Providers;
|
||||
|
||||
use Webkul\Core\Providers\CoreModuleServiceProvider;
|
||||
|
||||
class ModuleServiceProvider extends CoreModuleServiceProvider
|
||||
{
|
||||
protected $models = [
|
||||
\Webkul\Marketing\Models\Campaign::class,
|
||||
\Webkul\Marketing\Models\Template::class,
|
||||
\Webkul\Marketing\Models\Event::class,
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Repositories;
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
class CampaignRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Marketing\Contracts\Campaign';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Repositories;
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
class EventRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Marketing\Contracts\Event';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Marketing\Repositories;
|
||||
|
||||
use Webkul\Core\Eloquent\Repository;
|
||||
|
||||
class TemplateRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Specify Model class name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function model()
|
||||
{
|
||||
return 'Webkul\Marketing\Contracts\Template';
|
||||
}
|
||||
}
|
||||
|
|
@ -126,6 +126,7 @@ return [
|
|||
'conditions' => 'Conditions',
|
||||
'using' => 'by using this website',
|
||||
'agreement' => 'Agreement',
|
||||
'subscribe-to-newsletter' => 'Subscribe to newsletter',
|
||||
'success' => 'Account created successfully.',
|
||||
'success-verify' => 'Account created successfully, an e-mail has been sent for verification.',
|
||||
'success-verify-email-unsent' => 'Account created successfully, but verification e-mail unsent.',
|
||||
|
|
|
|||
|
|
@ -100,6 +100,11 @@
|
|||
<span class="control-error" v-if="errors.has('password_confirmation')">@{{ errors.first('password_confirmation') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter" value="{{ $customer->subscribed_to_news_letter }}" {{ $customer->subscribed_to_news_letter ? 'checked' : ''}}>
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!}
|
||||
|
||||
<div class="button-group">
|
||||
|
|
|
|||
|
|
@ -70,17 +70,19 @@
|
|||
<span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span>
|
||||
</div> --}}
|
||||
|
||||
{{-- <span class="checkbox">
|
||||
<input type="checkbox" id="checkbox1" name="checkbox[]">
|
||||
<label class="checkbox-view" for="checkbox1"></label>
|
||||
Checkbox Value 1
|
||||
</span> --}}
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="is_subscribed">
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!}
|
||||
|
||||
{{-- <div class="control-group" :class="[errors.has('agreement') ? 'has-error' : '']">
|
||||
|
||||
<input type="checkbox" id="checkbox2" name="agreement" v-validate="'required'" data-vv-as=""{{ __('shop::app.customer.signup-form.agreement') }}"">
|
||||
<span>{{ __('shop::app.customer.signup-form.agree') }}
|
||||
<a href="">{{ __('shop::app.customer.signup-form.terms') }}</a> & <a href="">{{ __('shop::app.customer.signup-form.conditions') }}</a> {{ __('shop::app.customer.signup-form.using') }}.
|
||||
</span>
|
||||
<span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span>
|
||||
</div> --}}
|
||||
|
||||
<button class="btn btn-primary btn-lg" type="submit">
|
||||
{{ __('shop::app.customer.signup-form.button_title') }}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -178,6 +178,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter" value="{{ $customer->subscribed_to_news_letter }}" {{ $customer->subscribed_to_news_letter ? 'checked' : ''}} style="width: auto;">
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!}
|
||||
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -138,6 +138,11 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="is_subscribed">
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!}
|
||||
|
||||
<button class="theme-btn" type="submit">
|
||||
|
|
|
|||
Loading…
Reference in New Issue