diff --git a/composer.json b/composer.json index b4a6b8fb9..d8eea72c9 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,6 @@ "diglactic/laravel-breadcrumbs": "^7.0", "doctrine/dbal": "^2.9", "enshrined/svg-sanitize": "^0.15.0", - "spatie/laravel-ignition": "^1.0", "fakerphp/faker": "^1.14", "flynsarmy/db-blade-compiler": "dev-master", "guzzlehttp/guzzle": "^7.0.1", @@ -36,7 +35,9 @@ "maatwebsite/excel": "^3.1.26", "paypal/paypal-checkout-sdk": "1.0.1", "prettus/l5-repository": "^2.6", - "pusher/pusher-php-server": "^7.0" + "pusher/pusher-php-server": "^7.0", + "spatie/laravel-ignition": "^1.0", + "spatie/laravel-sitemap": "^6.1" }, "require-dev": { "codeception/codeception": "*@dev", @@ -102,7 +103,8 @@ "Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src", "Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src", "Webkul\\Marketing\\": "packages/Webkul/Marketing/src", - "Webkul\\Notification\\": "packages/Webkul/Notification/src" + "Webkul\\Notification\\": "packages/Webkul/Notification/src", + "Webkul\\Sitemap\\": "packages/Webkul/Sitemap/src" } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 09b9b18e2..700514069 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "7bd7dd4e790275d3a14a8ab268f2972a", + "content-hash": "8ec53721d44a7274183e99125e4fef64", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -3479,6 +3479,71 @@ ], "time": "2022-03-12T19:32:12+00:00" }, + { + "name": "league/glide", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/glide.git", + "reference": "bff5b0fe2fd26b2fde2d6958715fde313887d79d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/glide/zipball/bff5b0fe2fd26b2fde2d6958715fde313887d79d", + "reference": "bff5b0fe2fd26b2fde2d6958715fde313887d79d", + "shasum": "" + }, + "require": { + "intervention/image": "^2.7", + "league/flysystem": "^2.0|^3.0", + "php": "^7.2|^8.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.3", + "phpunit/php-token-stream": "^3.1|^4.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Glide\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Reinink", + "email": "jonathan@reinink.ca", + "homepage": "http://reinink.ca" + }, + { + "name": "Titouan Galopin", + "email": "galopintitouan@gmail.com", + "homepage": "https://titouangalopin.com" + } + ], + "description": "Wonderfully easy on-demand image manipulation library with an HTTP based API.", + "homepage": "http://glide.thephpleague.com", + "keywords": [ + "ImageMagick", + "editing", + "gd", + "image", + "imagick", + "league", + "manipulation", + "processing" + ], + "support": { + "issues": "https://github.com/thephpleague/glide/issues", + "source": "https://github.com/thephpleague/glide/tree/2.2.2" + }, + "time": "2022-02-21T07:40:55+00:00" + }, { "name": "league/mime-type-detection", "version": "1.9.0", @@ -4402,6 +4467,52 @@ }, "time": "2022-01-24T11:29:14+00:00" }, + { + "name": "nicmart/tree", + "version": "0.3.1", + "source": { + "type": "git", + "url": "https://github.com/nicmart/Tree.git", + "reference": "c55ba47c64a3cb7454c22e6d630729fc2aab23ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nicmart/Tree/zipball/c55ba47c64a3cb7454c22e6d630729fc2aab23ff", + "reference": "c55ba47c64a3cb7454c22e6d630729fc2aab23ff", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.8.0", + "ergebnis/license": "^1.0.0", + "ergebnis/php-cs-fixer-config": "^2.2.1", + "phpunit/phpunit": "^7.5.20" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tree\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolò Martini", + "email": "nicmartnic@gmail.com" + } + ], + "description": "A basic but flexible php tree data structure and a fluent tree builder implementation.", + "support": { + "issues": "https://github.com/nicmart/Tree/issues", + "source": "https://github.com/nicmart/Tree/tree/0.3.1" + }, + "time": "2020-11-27T09:02:17+00:00" + }, { "name": "nikic/php-parser", "version": "v4.13.2", @@ -6075,6 +6186,139 @@ ], "time": "2021-11-09T10:57:15+00:00" }, + { + "name": "spatie/browsershot", + "version": "3.52.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/browsershot.git", + "reference": "4f8584e835035a4696a496c4508c3c35edaef28a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/4f8584e835035a4696a496c4508c3c35edaef28a", + "reference": "4f8584e835035a4696a496c4508c3c35edaef28a", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "spatie/image": "^1.5.3|^2.0", + "spatie/temporary-directory": "^1.1|^2.0", + "symfony/process": "^4.2|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "spatie/phpunit-snapshot-assertions": "^4.2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Browsershot\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://github.com/freekmurze", + "role": "Developer" + } + ], + "description": "Convert a webpage to an image or pdf using headless Chrome", + "homepage": "https://github.com/spatie/browsershot", + "keywords": [ + "chrome", + "convert", + "headless", + "image", + "pdf", + "puppeteer", + "screenshot", + "webpage" + ], + "support": { + "issues": "https://github.com/spatie/browsershot/issues", + "source": "https://github.com/spatie/browsershot/tree/3.52.3" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-12-17T23:11:39+00:00" + }, + { + "name": "spatie/crawler", + "version": "7.1.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/crawler.git", + "reference": "31f7eb8661340bc878f7e32a8ece90308ec713ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/crawler/zipball/31f7eb8661340bc878f7e32a8ece90308ec713ae", + "reference": "31f7eb8661340bc878f7e32a8ece90308ec713ae", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^2.0", + "illuminate/collections": "^8.38|^9.0", + "nicmart/tree": "^0.3.0", + "php": "^8.0", + "spatie/browsershot": "^3.45", + "spatie/robots-txt": "^2.0", + "symfony/dom-crawler": "^5.2|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Crawler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be" + } + ], + "description": "Crawl all internal links found on a website", + "homepage": "https://github.com/spatie/crawler", + "keywords": [ + "crawler", + "link", + "spatie", + "website" + ], + "support": { + "issues": "https://github.com/spatie/crawler/issues", + "source": "https://github.com/spatie/crawler/tree/7.1.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-03-20T17:08:21+00:00" + }, { "name": "spatie/flare-client-php", "version": "1.1.0", @@ -6209,6 +6453,129 @@ ], "time": "2022-03-23T11:02:14+00:00" }, + { + "name": "spatie/image", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/image.git", + "reference": "bdf1146c740746d635344f8291c491371c3f2f25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image/zipball/bdf1146c740746d635344f8291c491371c3f2f25", + "reference": "bdf1146c740746d635344f8291c491371c3f2f25", + "shasum": "" + }, + "require": { + "ext-exif": "*", + "ext-json": "*", + "ext-mbstring": "*", + "league/glide": "^2.2.2", + "php": "^8.0", + "spatie/image-optimizer": "^1.1", + "spatie/temporary-directory": "^1.0|^2.0", + "symfony/process": "^3.0|^4.0|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "symfony/var-dumper": "^4.0|^5.0|^6.0", + "vimeo/psalm": "^4.6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Image\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Manipulate images with an expressive API", + "homepage": "https://github.com/spatie/image", + "keywords": [ + "image", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/image/issues", + "source": "https://github.com/spatie/image/tree/2.2.2" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-02-21T08:27:27+00:00" + }, + { + "name": "spatie/image-optimizer", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/image-optimizer.git", + "reference": "6db75529cbf8fa84117046a9d513f277aead90a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/6db75529cbf8fa84117046a9d513f277aead90a0", + "reference": "6db75529cbf8fa84117046a9d513f277aead90a0", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.3|^8.0", + "psr/log": "^1.0 | ^2.0 | ^3.0", + "symfony/process": "^4.2|^5.0|^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.21|^9.4.4", + "symfony/var-dumper": "^4.2|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily optimize images using PHP", + "homepage": "https://github.com/spatie/image-optimizer", + "keywords": [ + "image-optimizer", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/image-optimizer/issues", + "source": "https://github.com/spatie/image-optimizer/tree/1.6.2" + }, + "time": "2021-12-21T10:08:05+00:00" + }, { "name": "spatie/laravel-ignition", "version": "1.1.1", @@ -6296,6 +6663,260 @@ ], "time": "2022-03-21T07:13:26+00:00" }, + { + "name": "spatie/laravel-package-tools", + "version": "1.11.3", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-package-tools.git", + "reference": "baeb3df0ebb3a541394fdaf8cbe6115bf4034a59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/baeb3df0ebb3a541394fdaf8cbe6115bf4034a59", + "reference": "baeb3df0ebb3a541394fdaf8cbe6115bf4034a59", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^7.0|^8.0|^9.0", + "php": "^7.4|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.4", + "orchestra/testbench": "^5.0|^6.23|^7.0", + "phpunit/phpunit": "^9.4", + "spatie/test-time": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\LaravelPackageTools\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Tools for creating Laravel packages", + "homepage": "https://github.com/spatie/laravel-package-tools", + "keywords": [ + "laravel-package-tools", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-package-tools/issues", + "source": "https://github.com/spatie/laravel-package-tools/tree/1.11.3" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-03-15T20:01:36+00:00" + }, + { + "name": "spatie/laravel-sitemap", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-sitemap.git", + "reference": "e51c68f9e51f476f3d6d92beb2cac0afa2de6d0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-sitemap/zipball/e51c68f9e51f476f3d6d92beb2cac0afa2de6d0d", + "reference": "e51c68f9e51f476f3d6d92beb2cac0afa2de6d0d", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^7.2", + "illuminate/support": "^8.0|^9.0", + "nesbot/carbon": "^2.0", + "php": "^8.0", + "spatie/crawler": "^7.0", + "spatie/laravel-package-tools": "^1.5", + "symfony/dom-crawler": "^5.1.14|^6.0" + }, + "require-dev": { + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6.23|^7.0", + "phpunit/phpunit": "^9.5", + "spatie/phpunit-snapshot-assertions": "^4.0", + "spatie/temporary-directory": "^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Sitemap\\SitemapServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Spatie\\Sitemap\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Create and generate sitemaps with ease", + "homepage": "https://github.com/spatie/laravel-sitemap", + "keywords": [ + "laravel-sitemap", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-sitemap/issues", + "source": "https://github.com/spatie/laravel-sitemap/tree/6.1.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2022-01-14T07:45:46+00:00" + }, + { + "name": "spatie/robots-txt", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/robots-txt.git", + "reference": "312ff78f39c0c7071fac3ee25edb0f4d1511dc60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/robots-txt/zipball/312ff78f39c0c7071fac3ee25edb0f4d1511dc60", + "reference": "312ff78f39c0c7071fac3ee25edb0f4d1511dc60", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "larapack/dd": "^1.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Robots\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Roose", + "email": "brent@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Determine if a page may be crawled from robots.txt and robots meta tags", + "homepage": "https://github.com/spatie/robots-txt", + "keywords": [ + "robots-txt", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/robots-txt/issues", + "source": "https://github.com/spatie/robots-txt/tree/2.0.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-05-06T16:55:55+00:00" + }, + { + "name": "spatie/temporary-directory", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/temporary-directory.git", + "reference": "79f138f2b81adae583d04d3727a4538dd394023f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/79f138f2b81adae583d04d3727a4538dd394023f", + "reference": "79f138f2b81adae583d04d3727a4538dd394023f", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\TemporaryDirectory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Vanderbist", + "email": "alex@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily create, use and destroy temporary directories", + "homepage": "https://github.com/spatie/temporary-directory", + "keywords": [ + "php", + "spatie", + "temporary-directory" + ], + "support": { + "issues": "https://github.com/spatie/temporary-directory/issues", + "source": "https://github.com/spatie/temporary-directory/tree/2.1.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-03-11T08:16:01+00:00" + }, { "name": "symfony/console", "version": "v6.0.5", @@ -6591,6 +7212,79 @@ ], "time": "2021-11-01T23:48:49+00:00" }, + { + "name": "symfony/dom-crawler", + "version": "v6.0.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/9b4126901a6146c151d95af3868b1e0e30519ea6", + "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "masterminds/html5": "<2.6" + }, + "require-dev": { + "masterminds/html5": "^2.6", + "symfony/css-selector": "^5.4|^6.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases DOM navigation for HTML and XML documents", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dom-crawler/tree/v6.0.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-02T12:58:14+00:00" + }, { "name": "symfony/error-handler", "version": "v6.0.3", @@ -11917,79 +12611,6 @@ ], "time": "2022-01-02T09:55:41+00:00" }, - { - "name": "symfony/dom-crawler", - "version": "v6.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/9b4126901a6146c151d95af3868b1e0e30519ea6", - "reference": "9b4126901a6146c151d95af3868b1e0e30519ea6", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "masterminds/html5": "<2.6" - }, - "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^5.4|^6.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases DOM navigation for HTML and XML documents", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.0.6" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-03-02T12:58:14+00:00" - }, { "name": "symfony/yaml", "version": "v6.0.3", @@ -12129,5 +12750,5 @@ "php": "^8.0.2" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.3.0" } diff --git a/config/app.php b/config/app.php index 88747d3aa..adbee11e7 100755 --- a/config/app.php +++ b/config/app.php @@ -280,7 +280,8 @@ return [ Webkul\SocialLogin\Providers\SocialLoginServiceProvider::class, Webkul\DebugBar\Providers\DebugBarServiceProvider::class, Webkul\Marketing\Providers\MarketingServiceProvider::class, - Webkul\Notification\Providers\NotificationServiceProvider::class + Webkul\Notification\Providers\NotificationServiceProvider::class, + Webkul\Sitemap\Providers\SitemapServiceProvider::class ], /* diff --git a/config/concord.php b/config/concord.php index 937a22ecc..5a76e239a 100755 --- a/config/concord.php +++ b/config/concord.php @@ -38,6 +38,7 @@ return [ \Webkul\Ui\Providers\ModuleServiceProvider::class, \Webkul\User\Providers\ModuleServiceProvider::class, \Webkul\Velocity\Providers\ModuleServiceProvider::class, + \Webkul\Sitemap\Providers\ModuleServiceProvider::class, ], ]; diff --git a/config/sitemap.php b/config/sitemap.php new file mode 100644 index 000000000..8ffec6972 --- /dev/null +++ b/config/sitemap.php @@ -0,0 +1,57 @@ + [ + + /* + * Whether or not cookies are used in a request. + */ + RequestOptions::COOKIES => true, + + /* + * The number of seconds to wait while trying to connect to a server. + * Use 0 to wait indefinitely. + */ + RequestOptions::CONNECT_TIMEOUT => 10, + + /* + * The timeout of the request in seconds. Use 0 to wait indefinitely. + */ + RequestOptions::TIMEOUT => 10, + + /* + * Describes the redirect behavior of a request. + */ + RequestOptions::ALLOW_REDIRECTS => false, + ], + + /* + * The sitemap generator can execute JavaScript on each page so it will + * discover links that are generated by your JS scripts. This feature + * is powered by headless Chrome. + */ + 'execute_javascript' => false, + + /* + * The package will make an educated guess as to where Google Chrome is installed. + * You can also manually pass it's location here. + */ + 'chrome_binary_path' => null, + + /* + * The sitemap generator uses a CrawlProfile implementation to determine + * which urls should be crawled for the sitemap. + */ + 'crawl_profile' => Profile::class, + +]; diff --git a/packages/Webkul/Admin/src/Config/acl.php b/packages/Webkul/Admin/src/Config/acl.php index 56677aa84..b9f12f518 100755 --- a/packages/Webkul/Admin/src/Config/acl.php +++ b/packages/Webkul/Admin/src/Config/acl.php @@ -349,7 +349,7 @@ return [ 'key' => 'marketing.promotions', 'name' => 'admin::app.acl.promotions', 'route' => 'admin.cart-rules.index', - 'sort' => 6, + 'sort' => 1, ], [ 'key' => 'marketing.promotions.cart-rules', 'name' => 'admin::app.acl.cart-rules', @@ -399,7 +399,7 @@ return [ 'key' => 'marketing.email-marketing', 'name' => 'admin::app.acl.email-marketing', 'route' => 'admin.email-templates.index', - 'sort' => 7, + 'sort' => 2, ], [ 'key' => 'marketing.email-marketing.email-templates', 'name' => 'admin::app.acl.email-templates', @@ -409,22 +409,22 @@ return [ 'key' => 'marketing.email-marketing.email-templates.create', 'name' => 'admin::app.acl.create', 'route' => 'admin.email-templates.create', - 'sort' => 1, + 'sort' => 2, ], [ 'key' => 'marketing.email-marketing.email-templates.edit', 'name' => 'admin::app.acl.edit', 'route' => 'admin.email-templates.edit', - 'sort' => 2, + 'sort' => 3, ], [ 'key' => 'marketing.email-marketing.email-templates.delete', 'name' => 'admin::app.acl.delete', 'route' => 'admin.email-templates.delete', - 'sort' => 3, + 'sort' => 4, ], [ 'key' => 'marketing.email-marketing.events', 'name' => 'admin::app.acl.events', 'route' => 'admin.events.index', - 'sort' => 1, + 'sort' => 2, ], [ 'key' => 'marketing.email-marketing.events.create', 'name' => 'admin::app.acl.create', @@ -444,7 +444,7 @@ return [ 'key' => 'marketing.email-marketing.campaigns', 'name' => 'admin::app.acl.campaigns', 'route' => 'admin.campaigns.index', - 'sort' => 1, + 'sort' => 3, ], [ 'key' => 'marketing.email-marketing.campaigns.create', 'name' => 'admin::app.acl.create', @@ -464,16 +464,36 @@ return [ 'key' => 'marketing.email-marketing.subscribers', 'name' => 'admin::app.acl.subscribers', 'route' => 'admin.customers.subscribers.index', - 'sort' => 1, + 'sort' => 4, ], [ 'key' => 'marketing.email-marketing.subscribers.edit', 'name' => 'admin::app.acl.edit', 'route' => 'admin.customers.subscribers.edit', - 'sort' => 2, + 'sort' => 1, ], [ 'key' => 'marketing.email-marketing.subscribers.delete', 'name' => 'admin::app.acl.delete', 'route' => 'admin.customers.subscribers.delete', + 'sort' => 2, + ], [ + 'key' => 'marketing.sitemaps', + 'name' => 'admin::app.acl.sitemaps', + 'route' => 'admin.sitemaps.index', + 'sort' => 3, + ], [ + 'key' => 'marketing.sitemaps.create', + 'name' => 'admin::app.acl.create', + 'route' => 'admin.sitemaps.create', + 'sort' => 1, + ], [ + 'key' => 'marketing.sitemaps.edit', + 'name' => 'admin::app.acl.edit', + 'route' => 'admin.sitemaps.edit', + 'sort' => 2, + ], [ + 'key' => 'marketing.sitemaps.delete', + 'name' => 'admin::app.acl.delete', + 'route' => 'admin.sitemaps.delete', 'sort' => 3, ], diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php index 41d97c10f..d91fb8002 100755 --- a/packages/Webkul/Admin/src/Config/menu.php +++ b/packages/Webkul/Admin/src/Config/menu.php @@ -235,6 +235,12 @@ return [ 'route' => 'admin.customers.subscribers.index', 'sort' => 3, 'icon-class' => '', + ], [ + 'key' => 'marketing.sitemaps', + 'name' => 'admin::app.layouts.sitemaps', + 'route' => 'admin.sitemaps.index', + 'sort' => 3, + 'icon-class' => '', ], [ 'key' => 'cms', 'name' => 'admin::app.layouts.cms', diff --git a/packages/Webkul/Admin/src/DataGrids/SitemapDataGrid.php b/packages/Webkul/Admin/src/DataGrids/SitemapDataGrid.php new file mode 100644 index 000000000..8e8d9a86f --- /dev/null +++ b/packages/Webkul/Admin/src/DataGrids/SitemapDataGrid.php @@ -0,0 +1,81 @@ +addSelect('id', 'file_name', 'path', 'path as url'); + + $this->setQueryBuilder($queryBuilder); + } + + public function addColumns() + { + $this->addColumn([ + 'index' => 'id', + 'label' => trans('admin::app.datagrid.id'), + 'type' => 'number', + 'searchable' => false, + 'sortable' => true, + 'width' => '40px', + 'filterable' => true, + ]); + + $this->addColumn([ + 'index' => 'file_name', + 'label' => trans('admin::app.datagrid.file-name'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + ]); + + $this->addColumn([ + 'index' => 'path', + 'label' => trans('admin::app.datagrid.path'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + ]); + + $this->addColumn([ + 'index' => 'url', + 'label' => trans('admin::app.datagrid.link-for-google'), + 'type' => 'string', + 'searchable' => false, + 'sortable' => false, + 'filterable' => false, + 'closure' => function ($row) { + return '' . $url . ''; + }, + ]); + } + + public function prepareActions() + { + $this->addAction([ + 'title' => trans('admin::app.datagrid.edit'), + 'method' => 'GET', + 'route' => 'admin.sitemaps.edit', + 'icon' => 'icon pencil-lg-icon', + ]); + + $this->addAction([ + 'title' => trans('admin::app.datagrid.delete'), + 'method' => 'POST', + 'route' => 'admin.sitemaps.delete', + 'icon' => 'icon trash-icon', + ]); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/lang/ar/app.php b/packages/Webkul/Admin/src/Resources/lang/ar/app.php index 405074c21..a3119ad3e 100644 --- a/packages/Webkul/Admin/src/Resources/lang/ar/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/ar/app.php @@ -80,6 +80,8 @@ return [ 'email-marketing' => 'التسويق عبر البريد الإلكتروني', 'campaigns' => 'الحملات', 'email-templates' => 'قوالب البريد الإلكتروني', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'خصم', 'cms' => 'CMS', 'transactions' => 'المعاملات', @@ -130,6 +132,13 @@ return [ 'promotions' => 'الترقيات', 'cart-rules' => 'قواعد سلة التسوق', 'catalog-rules' => 'قواعد الكتالوج', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -248,6 +257,9 @@ return [ 'update-status' => 'تحديث الحالة', 'transaction-id' => 'Transaction Id', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1269,6 +1281,21 @@ return [ 'delete-success' => 'تم حذف الحدث بنجاح.', 'edit-error' => 'لا يمكن تعديل هذا الحدث.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/de/app.php b/packages/Webkul/Admin/src/Resources/lang/de/app.php index be9ac9641..7b0333f74 100755 --- a/packages/Webkul/Admin/src/Resources/lang/de/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/de/app.php @@ -77,6 +77,8 @@ return [ 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campaigns', 'email-templates' => 'Email Templates', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'tax-categories' => 'Steuer-Kategorien', 'tax-rates' => 'Steuersätze', 'discount' => 'Rabatt', @@ -129,6 +131,13 @@ return [ 'promotions' => 'Promotions', 'cart-rules' => 'Warenkorbregeln', 'catalog-rules' => 'Katalogregeln', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -247,6 +256,9 @@ return [ 'update-status' => 'Update-Status', 'transaction-id' => 'Transaction Id', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1270,6 +1282,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Can not edit this event.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 87d64a872..a37e046d2 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -81,6 +81,7 @@ return [ 'campaigns' => 'Campaigns', 'email-templates' => 'Email Templates', 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'Discount', 'cms' => 'CMS', 'transactions' => 'Transactions', @@ -135,6 +136,7 @@ return [ 'campaigns' => 'Campaigns', 'subscribers' => 'Newsletter Subscribers', 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], @@ -257,6 +259,9 @@ return [ 'date' => 'Date', 'transaction-id' => 'Transaction ID', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1291,6 +1296,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Can not edit this event.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/es/app.php b/packages/Webkul/Admin/src/Resources/lang/es/app.php index 7fa570d1e..b6d2d7bc5 100644 --- a/packages/Webkul/Admin/src/Resources/lang/es/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/es/app.php @@ -81,6 +81,7 @@ return [ 'campaigns' => 'Campañas', 'email-templates' => 'Plantillas de Email', 'events' => 'Eventos', + 'sitemaps' => 'Sitemaps', 'discount' => 'Descuento', 'cms' => 'CMS', 'transactions' => 'Transakcioj', @@ -136,6 +137,8 @@ return [ 'campaigns' => 'Campañas', 'subscribers' => 'Suscriptores del Boletín', 'events' => 'Eventos', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -257,6 +260,9 @@ return [ 'date' => 'Fecha', 'transaction-id' => 'Transacción #', 'transaction-date' => 'Fecha de Transacción', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1278,6 +1284,21 @@ return [ 'delete-success' => 'Evento borrado con éxito.', 'edit-error' => 'No se puede editar este evento.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/fa/app.php b/packages/Webkul/Admin/src/Resources/lang/fa/app.php index d89ffd85e..550f4170a 100644 --- a/packages/Webkul/Admin/src/Resources/lang/fa/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/fa/app.php @@ -79,6 +79,8 @@ return [ 'email-marketing' => 'بازاریابی ایمیل', 'campaigns' => 'کمپین ها', 'email-templates' => 'قالب های ایمیل', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'تخفیف', 'cms' => 'مدیری محتوا', 'transactions' => 'پرداختی ها', @@ -128,6 +130,13 @@ return [ 'promotions' => 'تبلیغات', 'cart-rules' => 'قوانین سبد خرید', 'catalog-rules' => 'قوانین فهرست', + 'email-marketing' => 'Email Márketing', + 'email-templates' => 'Plantillas de Email', + 'campaigns' => 'Campañas', + 'subscribers' => 'Suscriptores del Boletín', + 'events' => 'Eventos', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -247,6 +256,9 @@ return [ 'transaction-date' => 'تارید پرداخت', 'date' => 'تاریخ', 'subject' => 'موضوع', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1257,6 +1269,21 @@ return [ 'delete-success' => 'رویداد مورد نظر حذف شد.', 'edit-error' => 'شما نمی توانید این رویداد را ویرایش کنید.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/fr/app.php b/packages/Webkul/Admin/src/Resources/lang/fr/app.php index 0d2f261cf..bc1a5b6f3 100644 --- a/packages/Webkul/Admin/src/Resources/lang/fr/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/fr/app.php @@ -80,6 +80,7 @@ return [ 'campaigns' => 'Campagnes', 'email-templates' => 'Modèles d\'e-mails', 'events' => 'Événements', + 'sitemaps' => 'Sitemaps', 'discount' => 'Rabais', 'cms' => 'CMS', 'transactions' => 'Transactions', @@ -135,6 +136,7 @@ return [ 'campaigns' => 'Campagnes', 'subscribers' => 'Abonnés à la newsletter', 'events' => 'Événements', + 'sitemaps' => 'Sitemaps', 'newsletter-subscriptions' => 'Abonnement à la Newsletter', ], @@ -257,6 +259,9 @@ return [ 'date' => 'Date', 'transaction-id' => 'identifiant de transaction', 'transaction-date' => 'Date de la transaction', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1289,6 +1294,21 @@ return [ 'delete-success' => 'Événement supprimé avec succès.', 'edit-error' => 'Impossible de modifier cet événement.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php b/packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php index 8971e7899..cbbc2215a 100644 --- a/packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php @@ -81,6 +81,7 @@ return [ 'campaigns' => 'अभियान', 'email-templates' => 'ईमेल टेम्प्लेट', 'events' => 'आयोजन', + 'sitemaps' => 'Sitemaps', 'discount' => 'छूट', 'cms' => 'सीएमएस', 'transactions' => 'लेनदेन', @@ -135,6 +136,7 @@ return [ 'campaigns' => 'अभियान', 'subscribers' => 'न्यूज़लेटर सब्सक्राइबर्स', 'events' => 'आयोजन', + 'sitemaps' => 'Sitemaps', 'newsletter-subscriptions' => 'न्यूज़लेटर सदस्यता', ], @@ -257,6 +259,9 @@ return [ 'date' => 'तारीख', 'transaction-id' => 'लेनदेन आईडी', 'transaction-date' => 'कार्यवाही की तिथि', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1291,6 +1296,21 @@ return [ 'delete-success' => 'ईवेंट सफलतापूर्वक हटाया गया।', 'edit-error' => 'इस घटना को संपादित नहीं कर सकता।', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/it/app.php b/packages/Webkul/Admin/src/Resources/lang/it/app.php index 1d7722143..4514a5c38 100644 --- a/packages/Webkul/Admin/src/Resources/lang/it/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/it/app.php @@ -79,6 +79,8 @@ return [ 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campaigns', 'email-templates' => 'Email Templates', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'Sconti', 'cms' => 'CMS', 'transactions' => 'Transactions', @@ -127,6 +129,13 @@ return [ 'promotions' => 'Promozioni', 'cart-rules' => 'Regole Carrello', 'catalog-rules' => 'Regole Catalogo', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -245,6 +254,9 @@ return [ 'update-status' => 'Update Stato', 'transaction-id' => 'Transaction Id', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1260,6 +1272,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Can not edit this event.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/nl/app.php b/packages/Webkul/Admin/src/Resources/lang/nl/app.php index f1cf3d989..0ec4cea55 100644 --- a/packages/Webkul/Admin/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/nl/app.php @@ -79,6 +79,8 @@ return [ 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campaigns', 'email-templates' => 'Email Templates', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'Korting', 'cms' => 'CMS', 'transactions' => 'Transacties', @@ -129,6 +131,13 @@ return [ 'promotions' => 'Promoties', 'cart-rules' => 'Cart Rules', 'catalog-rules' => 'Catalog Rules', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -245,6 +254,9 @@ return [ 'rtl' => 'RTL', 'ltr' => 'LTR', 'update-status' => 'Update Status', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1256,6 +1268,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Can not edit this event.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/pl/app.php b/packages/Webkul/Admin/src/Resources/lang/pl/app.php index 274b4ef51..42d9532e3 100644 --- a/packages/Webkul/Admin/src/Resources/lang/pl/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/pl/app.php @@ -77,6 +77,8 @@ return [ 'promotions' => 'Promocje', 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campaigns', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'email-templates' => 'Email Templates', 'discount' => 'Rabat', 'cms' => 'System CMS', @@ -126,6 +128,13 @@ return [ 'promotions' => 'Promocje', 'cart-rules' => 'Zasady koszyka', 'catalog-rules' => 'Zasady katalogu', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -243,6 +252,9 @@ return [ 'update-status' => 'Aktualizcja statusu', 'transaction-id' => 'Transaction Id', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1257,6 +1269,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Can not edit this event.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php index 14613e60a..abc3ea2f0 100755 --- a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php @@ -79,6 +79,8 @@ return [ 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campanhas', 'email-templates' => 'Email Templates', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'Desconto', 'cms' => 'CMS', 'transactions' => 'Transações', @@ -127,6 +129,13 @@ return [ 'promotions' => 'Promoções', 'cart-rules' => 'Regras do Carrinho', 'catalog-rules' => 'Regras do Catálogo', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -244,6 +253,9 @@ return [ 'update-status' => 'Atualizar o status', 'transaction-id' => 'Transaction Id', 'transaction-date' => 'Transaction Date', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1256,6 +1268,21 @@ return [ 'delete-success' => 'Event deleted successfully.', 'edit-error' => 'Não é possível editar esse evento.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/tr/app.php b/packages/Webkul/Admin/src/Resources/lang/tr/app.php index 8cea1ff67..d116a952f 100644 --- a/packages/Webkul/Admin/src/Resources/lang/tr/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/tr/app.php @@ -77,6 +77,8 @@ return [ 'email-marketing' => 'Email Marketing', 'campaigns' => 'Campaigns', 'email-templates' => 'Email Templates', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', 'discount' => 'İndirim', 'cms' => 'CMS', 'transactions' => 'işlemler', @@ -127,6 +129,13 @@ return [ 'promotions' => 'Promosyonlar', 'cart-rules' => 'Alışveriş Sepeti Kuralları', 'catalog-rules' => 'Katalog Kuralları', + 'email-marketing' => 'Email Marketing', + 'email-templates' => 'Email Templates', + 'campaigns' => 'Campaigns', + 'subscribers' => 'Newsletter Subscribers', + 'events' => 'Events', + 'sitemaps' => 'Sitemaps', + 'newsletter-subscriptions' => 'Newsletter Subscriptions', ], 'dashboard' => [ @@ -244,6 +253,9 @@ return [ 'update-status' => 'Durum Güncelle', 'transaction-id' => 'İşlem Id', 'transaction-date' => 'İşlem Tarihi', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1256,6 +1268,21 @@ return [ 'delete-success' => 'Etkinlik başarıyla silindi.', 'edit-error' => 'Bu etkinlik düzenlenemiyor.', ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', + ] ], 'error' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php b/packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php index 35d5a7212..bd0cacc1a 100644 --- a/packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php @@ -80,6 +80,7 @@ return [ 'campaigns' => '广告活动', 'email-templates' => '邮件模板', 'events' => '事件列表', + 'sitemaps' => 'Sitemaps', 'discount' => '折扣', 'cms' => 'CMS', 'transactions' => '事物列表', @@ -87,52 +88,53 @@ return [ ], 'acl' => [ - 'dashboard' => '仪表盘', - 'sales' => '销售列表', - 'cancel' => '取消', - 'orders' => '订单列表', - 'shipments' => '发货列表', - 'invoices' => '发票列表', - 'refunds' => '退款列表', - 'catalog' => '商品目录', - 'products' => '产品列表', - 'copy' => '复制', - 'categories' => '分类列表', - 'attributes' => '属性列表', - 'attribute-families' => '属性家族', - 'customers' => '客户列表', - 'addresses' => '地址列表', - 'note' => '备注', - 'groups' => '客户群', - 'reviews' => '评论列表', - 'configure' => '全局配置', - 'settings' => '系统设置', - 'locales' => '多语言', - 'currencies' => '货币列表', - 'exchange-rates' => '汇率换算', - 'inventory-sources' => '货源列表', - 'channels' => '渠道列表', - 'users' => '后台用户', - 'roles' => '权限规则', - 'sliders' => '图片轮播', - 'taxes' => '税务列表', - 'tax-categories' => '税务分类', - 'tax-rates' => '税率', - 'view' => '查看', - 'edit' => '编辑', - 'create' => '添加', - 'delete' => '删除', - 'mass-delete' => '批量删除', - 'mass-update' => '批量更新', - 'marketing' => '市场营销', - 'promotions' => '促销活动', - 'cart-rules' => '购物车规则', - 'catalog-rules' => '商品目录规则', - 'email-marketing' => '邮件营销', - 'email-templates' => '邮件模板', - 'campaigns' => '活动列表', - 'subscribers' => '邮件订阅', - 'events' => '事件列表', + 'dashboard' => '仪表盘', + 'sales' => '销售列表', + 'cancel' => '取消', + 'orders' => '订单列表', + 'shipments' => '发货列表', + 'invoices' => '发票列表', + 'refunds' => '退款列表', + 'catalog' => '商品目录', + 'products' => '产品列表', + 'copy' => '复制', + 'categories' => '分类列表', + 'attributes' => '属性列表', + 'attribute-families' => '属性家族', + 'customers' => '客户列表', + 'addresses' => '地址列表', + 'note' => '备注', + 'groups' => '客户群', + 'reviews' => '评论列表', + 'configure' => '全局配置', + 'settings' => '系统设置', + 'locales' => '多语言', + 'currencies' => '货币列表', + 'exchange-rates' => '汇率换算', + 'inventory-sources' => '货源列表', + 'channels' => '渠道列表', + 'users' => '后台用户', + 'roles' => '权限规则', + 'sliders' => '图片轮播', + 'taxes' => '税务列表', + 'tax-categories' => '税务分类', + 'tax-rates' => '税率', + 'view' => '查看', + 'edit' => '编辑', + 'create' => '添加', + 'delete' => '删除', + 'mass-delete' => '批量删除', + 'mass-update' => '批量更新', + 'marketing' => '市场营销', + 'promotions' => '促销活动', + 'cart-rules' => '购物车规则', + 'catalog-rules' => '商品目录规则', + 'email-marketing' => '邮件营销', + 'email-templates' => '邮件模板', + 'campaigns' => '活动列表', + 'subscribers' => '邮件订阅', + 'events' => '事件列表', + 'sitemaps' => 'Sitemaps', 'newsletter-subscriptions' => '邮件列表订阅', ], @@ -255,6 +257,9 @@ return [ 'date' => '日期', 'transaction-id' => '交易ID', 'transaction-date' => '交易日期', + 'file-name' => 'File Name', + 'path' => 'Path', + 'link-for-google' => 'Link For Google', ], 'account' => [ @@ -1264,6 +1269,21 @@ return [ 'update-success' => '事件更新成功.', 'delete-success' => '事件删除成功.', 'edit-error' => '无法编辑此活动.' + ], + + 'sitemaps' => [ + 'title' => 'Sitemaps', + 'add-title' => 'Add Sitemap', + 'edit-title' => 'Edit Sitemap', + 'save-btn-title' => 'Save', + 'general' => 'General', + 'file-name' => 'File Name', + 'file-name-info' => 'Example: sitemap.xml', + 'path' => 'Path', + 'path-info' => 'Example: "/sitemap/" or "/" for base path', + 'create-success' => 'Sitemap created successfully.', + 'update-success' => 'Sitemap updated successfully.', + 'delete-success' => 'Sitemap deleted successfully.', ] ], diff --git a/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/create.blade.php b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/create.blade.php new file mode 100755 index 000000000..d1d70c72a --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/create.blade.php @@ -0,0 +1,58 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.marketing.sitemaps.add-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + {!! view_render_event('bagisto.admin.marketing.sitemaps.create.before') !!} + + +
+
+ + + @{{ errors.first('file_name') }} + {{ __('admin::app.marketing.sitemaps.file-name-info') }} +
+ +
+ + + @{{ errors.first('path') }} + {{ __('admin::app.marketing.sitemaps.path-info') }} +
+ +
+
+ + {!! view_render_event('bagisto.admin.marketing.sitemaps.create.after') !!} + +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/edit.blade.php new file mode 100755 index 000000000..6695acbc1 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/edit.blade.php @@ -0,0 +1,60 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.marketing.sitemaps.edit-title') }} +@stop + +@section('content') +
+ +
+ + +
+
+ @csrf() + + + + {!! view_render_event('bagisto.admin.marketing.sitemaps.update.before') !!} + + +
+
+ + + @{{ errors.first('file_name') }} + {{ __('admin::app.marketing.sitemaps.file-name-info') }} +
+ +
+ + + @{{ errors.first('path') }} + {{ __('admin::app.marketing.sitemaps.path-info') }} +
+ +
+
+ + {!! view_render_event('bagisto.admin.marketing.sitemaps.update.after') !!} + +
+
+
+
+@stop \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/index.blade.php b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/index.blade.php new file mode 100644 index 000000000..8b148e862 --- /dev/null +++ b/packages/Webkul/Admin/src/Resources/views/marketing/sitemaps/index.blade.php @@ -0,0 +1,25 @@ +@extends('admin::layouts.content') + +@section('page_title') + {{ __('admin::app.marketing.sitemaps.title') }} +@stop + +@section('content') +
+ + +
+ +
+
+@endsection diff --git a/packages/Webkul/Admin/src/Routes/marketing-routes.php b/packages/Webkul/Admin/src/Routes/marketing-routes.php index 4310eaa8f..53722cd7b 100644 --- a/packages/Webkul/Admin/src/Routes/marketing-routes.php +++ b/packages/Webkul/Admin/src/Routes/marketing-routes.php @@ -8,6 +8,7 @@ use Webkul\Core\Http\Controllers\SubscriptionController; use Webkul\Marketing\Http\Controllers\CampaignController; use Webkul\Marketing\Http\Controllers\EventController; use Webkul\Marketing\Http\Controllers\TemplateController; +use Webkul\Sitemap\Http\Controllers\Admin\SitemapController; /** * Marketing routes. @@ -171,5 +172,31 @@ Route::group(['middleware' => ['web', 'admin', 'admin_locale'], 'prefix' => conf Route::put('subscribers/update/{id}', [SubscriptionController::class, 'update'])->defaults('_config', [ 'redirect' => 'admin.customers.subscribers.index', ])->name('admin.customers.subscribers.update'); + + + /** + * Cart rules routes. + */ + Route::get('sitemaps', [SitemapController::class, 'index'])->defaults('_config', [ + 'view' => 'admin::marketing.sitemaps.index', + ])->name('admin.sitemaps.index'); + + Route::get('sitemaps/create', [SitemapController::class, 'create'])->defaults('_config', [ + 'view' => 'admin::marketing.sitemaps.create', + ])->name('admin.sitemaps.create'); + + Route::post('sitemaps/create', [SitemapController::class, 'store'])->defaults('_config', [ + 'redirect' => 'admin.sitemaps.index', + ])->name('admin.sitemaps.store'); + + Route::get('sitemaps/edit/{id}', [SitemapController::class, 'edit'])->defaults('_config', [ + 'view' => 'admin::marketing.sitemaps.edit', + ])->name('admin.sitemaps.edit'); + + Route::put('sitemaps/edit/{id}', [SitemapController::class, 'update'])->defaults('_config', [ + 'redirect' => 'admin.sitemaps.index', + ])->name('admin.sitemaps.update'); + + Route::post('sitemaps/delete/{id}', [SitemapController::class, 'destroy'])->name('admin.sitemaps.delete'); }); }); diff --git a/packages/Webkul/Core/src/Config/concord.php b/packages/Webkul/Core/src/Config/concord.php index 937a22ecc..5a76e239a 100644 --- a/packages/Webkul/Core/src/Config/concord.php +++ b/packages/Webkul/Core/src/Config/concord.php @@ -38,6 +38,7 @@ return [ \Webkul\Ui\Providers\ModuleServiceProvider::class, \Webkul\User\Providers\ModuleServiceProvider::class, \Webkul\Velocity\Providers\ModuleServiceProvider::class, + \Webkul\Sitemap\Providers\ModuleServiceProvider::class, ], ]; diff --git a/packages/Webkul/Sitemap/src/Contracts/Sitemap.php b/packages/Webkul/Sitemap/src/Contracts/Sitemap.php new file mode 100644 index 000000000..649bb1da6 --- /dev/null +++ b/packages/Webkul/Sitemap/src/Contracts/Sitemap.php @@ -0,0 +1,7 @@ +increments('id'); + $table->string('file_name'); + $table->string('path'); + + $table->datetime('generated_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('sitemaps'); + } +}; diff --git a/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php b/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php new file mode 100644 index 000000000..d2ef75009 --- /dev/null +++ b/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php @@ -0,0 +1,145 @@ +_config = request('_config'); + } + + /** + * Display a listing of the resource. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + if (request()->ajax()) { + return app(SitemapDataGrid::class)->toJson(); + } + + 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(), [ + 'file_name' => 'required', + 'path' => 'required', + ]); + + Event::dispatch('marketing.sitemaps.create.before'); + + $sitemap = $this->sitemapRepository->create(request()->all()); + + Event::dispatch('marketing.sitemaps.create.after', $sitemap); + + session()->flash('success', trans('admin::app.marketing.sitemaps.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) + { + $sitemap = $this->sitemapRepository->findOrFail($id); + + return view($this->_config['view'], compact('sitemap')); + } + + /** + * Update the specified resource in storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update($id) + { + $this->validate(request(), [ + 'file_name' => 'required', + 'path' => 'required', + ]); + + Event::dispatch('marketing.sitemaps.update.before', $id); + + $sitemap = $this->sitemapRepository->update(request()->all(), $id); + + Event::dispatch('marketing.sitemaps.update.after', $sitemap); + + session()->flash('success', trans('admin::app.marketing.sitemaps.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) + { + $sitemap = $this->sitemapRepository->findOrFail($id); + + Storage::delete($sitemap->path . '/' . $sitemap->file_name); + + try { + Event::dispatch('marketing.sitemaps.delete.before', $id); + + $this->sitemapRepository->delete($id); + + Event::dispatch('marketing.sitemaps.delete.after', $id); + + return response()->json(['message' => trans('admin::app.marketing.sitemaps.delete-success')]); + } catch (\Exception $e) {} + + return response()->json(['message' => trans('admin::app.response.delete-failed', ['name' => 'Sitemap'])], 500); + } +} diff --git a/packages/Webkul/Sitemap/src/Models/Category.php b/packages/Webkul/Sitemap/src/Models/Category.php new file mode 100644 index 000000000..19a4bcf44 --- /dev/null +++ b/packages/Webkul/Sitemap/src/Models/Category.php @@ -0,0 +1,24 @@ +slug + || ! $this->status + ) { + return []; + } + + return route('shop.productOrCategory.index', $this->slug); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sitemap/src/Models/CategoryTranslation.php b/packages/Webkul/Sitemap/src/Models/CategoryTranslation.php new file mode 100755 index 000000000..f72d8684a --- /dev/null +++ b/packages/Webkul/Sitemap/src/Models/CategoryTranslation.php @@ -0,0 +1,9 @@ +url_key) { + return []; + } + + return route('shop.cms.page', $this->url_key); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sitemap/src/Models/CmsPageTranslation.php b/packages/Webkul/Sitemap/src/Models/CmsPageTranslation.php new file mode 100644 index 000000000..a6259b400 --- /dev/null +++ b/packages/Webkul/Sitemap/src/Models/CmsPageTranslation.php @@ -0,0 +1,9 @@ +url_key + || ! $this->status + || ! $this->visible_individually + ) { + return []; + } + + return route('shop.productOrCategory.index', $this->url_key); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sitemap/src/Models/Sitemap.php b/packages/Webkul/Sitemap/src/Models/Sitemap.php new file mode 100644 index 000000000..84819389d --- /dev/null +++ b/packages/Webkul/Sitemap/src/Models/Sitemap.php @@ -0,0 +1,15 @@ +app->register(ModuleServiceProvider::class); + + $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations'); + } +} \ No newline at end of file diff --git a/packages/Webkul/Sitemap/src/Repositories/SitemapRepository.php b/packages/Webkul/Sitemap/src/Repositories/SitemapRepository.php new file mode 100644 index 000000000..2e9844497 --- /dev/null +++ b/packages/Webkul/Sitemap/src/Repositories/SitemapRepository.php @@ -0,0 +1,73 @@ +generateSitemap($sitemap); + + return $sitemap; + } + + /** + * Update. + * + * @param array $attributes + * @param $id + * @return mixed + */ + public function update(array $attributes, $id) + { + $sitemap = $this->find($id); + + Storage::delete($sitemap->path . '/' . $sitemap->file_name); + + $sitemap = parent::update($attributes, $id); + + $this->generateSitemap($sitemap); + } + + /** + * Update. + * + * @param \Webkul\Sitemap\Contracts\Sitemap $sitemap + * @return void + */ + public function generateSitemap($sitemap) + { + Sitemap::create() + ->add(Url::create('/')) + ->add(Category::all()) + ->add(Product::all()) + ->add(CmsPage::all()) + ->writeToDisk('public', $sitemap->path . '/' . $sitemap->file_name); + } +} \ No newline at end of file