Skip to content

Commit

Permalink
Merge pull request #26 from ARCANEDEV/update-laravel_7.x
Browse files Browse the repository at this point in the history
Updating the package to support Laravel 7
  • Loading branch information
arcanedev-maroc authored Mar 6, 2020
2 parents 07d73de + a64c4ac commit 2b6df2a
Show file tree
Hide file tree
Showing 25 changed files with 656 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This package allows you to manage and generate a sitemap without you having to a
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `5.4` to `6.x` are supported.
* Laravel `5.4` to `7.x` are supported.
* Made with :heart: & :coffee:.

## Table of contents
Expand All @@ -41,7 +41,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
- [ARCANEDEV][link-author]
- [All Contributors][link-contributors]

[badge_laravel]: https://img.shields.io/badge/Laravel-5.4%20to%206.x-orange.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/Laravel-5.4%20to%207.x-orange.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-sitemap.svg?style=flat-square
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelSitemap/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelSitemap.svg?style=flat-square
Expand Down
2 changes: 1 addition & 1 deletion _docs/0-Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This package allows you to manage and generate a sitemap without you having to a
### Features

* Easy setup & configuration.
* Laravel `5.4` to `6.x` are supported.
* Laravel `5.4` to `7.x` are supported.
* SEO-Friendly (Search engine optimization).
* Respects the [sitemaps.org](https://www.sitemaps.org/protocol.html) schemas.
* Multiple URLs & Sitemaps management.
Expand Down
33 changes: 18 additions & 15 deletions _docs/1-Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@

| Laravel Sitemap | Laravel |
|:-------------------------------------------------|:-----------------------------|
| ![Laravel Sitemap v1.0.x][laravel_sitemap_1_0_x] | ![Laravel v5.4][laravel_5_4] |
| ![Laravel Sitemap v1.1.x][laravel_sitemap_1_1_x] | ![Laravel v5.5][laravel_5_5] |
| ![Laravel Sitemap v1.2.x][laravel_sitemap_1_2_x] | ![Laravel v5.6][laravel_5_6] |
| ![Laravel Sitemap v1.3.x][laravel_sitemap_1_3_x] | ![Laravel v5.7][laravel_5_7] |
| ![Laravel Sitemap v1.4.x][laravel_sitemap_1_4_x] | ![Laravel v5.8][laravel_5_8] |
| ![Laravel Sitemap v3.x][laravel_sitemap_3_x] | ![Laravel v7.x][laravel_7_x] |
| ![Laravel Sitemap v2.x][laravel_sitemap_2_x] | ![Laravel v6.x][laravel_6_x] |
| ![Laravel Sitemap v1.4.x][laravel_sitemap_1_4_x] | ![Laravel v5.8][laravel_5_8] |
| ![Laravel Sitemap v1.3.x][laravel_sitemap_1_3_x] | ![Laravel v5.7][laravel_5_7] |
| ![Laravel Sitemap v1.2.x][laravel_sitemap_1_2_x] | ![Laravel v5.6][laravel_5_6] |
| ![Laravel Sitemap v1.1.x][laravel_sitemap_1_1_x] | ![Laravel v5.5][laravel_5_5] |
| ![Laravel Sitemap v1.0.x][laravel_sitemap_1_0_x] | ![Laravel v5.4][laravel_5_4] |

[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
[laravel_7_x]: https://img.shields.io/badge/v7.x-supported-brightgreen.svg?style=flat-square "Laravel v7.0"
[laravel_6_x]: https://img.shields.io/badge/v6.x-supported-brightgreen.svg?style=flat-square "Laravel v6.0"
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"

[laravel_sitemap_1_0_x]: https://img.shields.io/badge/version-1.0.x-blue.svg?style=flat-square "Laravel Sitemap v1.0.x"
[laravel_sitemap_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "Laravel Sitemap v1.1.x"
[laravel_sitemap_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "Laravel Sitemap v1.2.x"
[laravel_sitemap_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "Laravel Sitemap v1.3.x"
[laravel_sitemap_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "Laravel Sitemap v1.4.x"
[laravel_sitemap_3_x]: https://img.shields.io/badge/version-3.x-blue.svg?style=flat-square "Laravel Sitemap v3.x"
[laravel_sitemap_2_x]: https://img.shields.io/badge/version-2.x-blue.svg?style=flat-square "Laravel Sitemap v2.x"
[laravel_sitemap_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "Laravel Sitemap v1.4.x"
[laravel_sitemap_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "Laravel Sitemap v1.3.x"
[laravel_sitemap_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "Laravel Sitemap v1.2.x"
[laravel_sitemap_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "Laravel Sitemap v1.1.x"
[laravel_sitemap_1_0_x]: https://img.shields.io/badge/version-1.0.x-blue.svg?style=flat-square "Laravel Sitemap v1.0.x"

## Composer

Expand Down
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=7.2.0",
"php": "^7.2.5",
"ext-dom": "*",
"ext-json": "*",
"arcanedev/support": "^5.1.1"
"arcanedev/support": "^7.0"
},
"require-dev": {
"orchestra/testbench": "^4.0",
"phpunit/phpcov": "^6.0",
"phpunit/phpunit": "^8.0",
"spatie/phpunit-snapshot-assertions": "^2.1"
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.5|^9.0",
"spatie/phpunit-snapshot-assertions": "^3.0|^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -42,5 +41,7 @@
"Arcanedev\\LaravelSitemap\\LaravelSitemapServiceProvider"
]
}
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
11 changes: 8 additions & 3 deletions src/LaravelSitemapServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ public function register(): void
*/
public function boot(): void
{
$this->publishConfig();
$this->publishViews();
$this->publishTranslations();
$this->loadTranslations();
$this->loadViews();

if ($this->app->runningInConsole()) {
$this->publishConfig();
$this->publishTranslations();
$this->publishViews();
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/SitemapManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private function saveMultiple(string $path, SitemapContract $sitemap)

foreach ($chunks as $key => $item) {
file_put_contents(
$pathInfo['dirname'].DS.$pathInfo['filename'].'-'.$key.'.'.$pathInfo['extension'],
$pathInfo['dirname'].DIRECTORY_SEPARATOR.$pathInfo['filename'].'-'.$key.'.'.$pathInfo['extension'],
SitemapBuilder::make()->build((string) $key, $chunks, $this->format)
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
http://example.com/sitemap-blog-1.xml
http://example.com/sitemap-blog-2.xml
http://example.com/sitemap-blog-3.xml
http://example.com/sitemap-blog-4.xml
http://example.com/sitemap-blog-5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
http://example.com/blog
http://example.com/blog/posts/post-1
http://example.com/blog/posts/post-2
http://example.com/blog/posts/post-3
http://example.com/blog/posts/post-4
http://example.com/blog/posts/post-5
http://example.com/blog/posts/post-6
http://example.com/blog/posts/post-7
http://example.com/blog/posts/post-8
http://example.com/blog/posts/post-9
http://example.com/blog/posts/post-10
http://example.com/blog/posts/post-11
http://example.com/blog/posts/post-12
http://example.com/blog/posts/post-13
http://example.com/blog/posts/post-14
http://example.com/blog/posts/post-15
http://example.com/blog/posts/post-16
http://example.com/blog/posts/post-17
http://example.com/blog/posts/post-18
http://example.com/blog/posts/post-19
http://example.com/blog/posts/post-20
http://example.com/blog/posts/post-21
http://example.com/blog/posts/post-22
http://example.com/blog/posts/post-23
http://example.com/blog/posts/post-24
http://example.com/blog/posts/post-25
http://example.com/blog/posts/post-26
http://example.com/blog/posts/post-27
http://example.com/blog/posts/post-28
http://example.com/blog/posts/post-29
http://example.com/blog/posts/post-30
http://example.com/blog/posts/post-31
http://example.com/blog/posts/post-32
http://example.com/blog/posts/post-33
http://example.com/blog/posts/post-34
http://example.com/blog/posts/post-35
http://example.com/blog/posts/post-36
http://example.com/blog/posts/post-37
http://example.com/blog/posts/post-38
http://example.com/blog/posts/post-39
http://example.com/blog/posts/post-40
http://example.com/blog/posts/post-41
http://example.com/blog/posts/post-42
http://example.com/blog/posts/post-43
http://example.com/blog/posts/post-44
http://example.com/blog/posts/post-45
http://example.com/blog/posts/post-46
http://example.com/blog/posts/post-47
http://example.com/blog/posts/post-48
http://example.com/blog/posts/post-49
http://example.com/blog/posts/post-50
http://example.com/blog/posts/post-51
http://example.com/blog/posts/post-52
http://example.com/blog/posts/post-53
http://example.com/blog/posts/post-54
http://example.com/blog/posts/post-55
http://example.com/blog/posts/post-56
http://example.com/blog/posts/post-57
http://example.com/blog/posts/post-58
http://example.com/blog/posts/post-59
http://example.com/blog/posts/post-60
http://example.com/blog/posts/post-61
http://example.com/blog/posts/post-62
http://example.com/blog/posts/post-63
http://example.com/blog/posts/post-64
http://example.com/blog/posts/post-65
http://example.com/blog/posts/post-66
http://example.com/blog/posts/post-67
http://example.com/blog/posts/post-68
http://example.com/blog/posts/post-69
http://example.com/blog/posts/post-70
http://example.com/blog/posts/post-71
http://example.com/blog/posts/post-72
http://example.com/blog/posts/post-73
http://example.com/blog/posts/post-74
http://example.com/blog/posts/post-75
http://example.com/blog/posts/post-76
http://example.com/blog/posts/post-77
http://example.com/blog/posts/post-78
http://example.com/blog/posts/post-79
http://example.com/blog/posts/post-80
http://example.com/blog/posts/post-81
http://example.com/blog/posts/post-82
http://example.com/blog/posts/post-83
http://example.com/blog/posts/post-84
http://example.com/blog/posts/post-85
http://example.com/blog/posts/post-86
http://example.com/blog/posts/post-87
http://example.com/blog/posts/post-88
http://example.com/blog/posts/post-89
http://example.com/blog/posts/post-90
http://example.com/blog/posts/post-91
http://example.com/blog/posts/post-92
http://example.com/blog/posts/post-93
http://example.com/blog/posts/post-94
http://example.com/blog/posts/post-95
http://example.com/blog/posts/post-96
http://example.com/blog/posts/post-97
http://example.com/blog/posts/post-98
http://example.com/blog/posts/post-99
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
http://example.com/blog/posts/post-100
http://example.com/blog/posts/post-101
http://example.com/blog/posts/post-102
http://example.com/blog/posts/post-103
http://example.com/blog/posts/post-104
http://example.com/blog/posts/post-105
http://example.com/blog/posts/post-106
http://example.com/blog/posts/post-107
http://example.com/blog/posts/post-108
http://example.com/blog/posts/post-109
http://example.com/blog/posts/post-110
http://example.com/blog/posts/post-111
http://example.com/blog/posts/post-112
http://example.com/blog/posts/post-113
http://example.com/blog/posts/post-114
http://example.com/blog/posts/post-115
http://example.com/blog/posts/post-116
http://example.com/blog/posts/post-117
http://example.com/blog/posts/post-118
http://example.com/blog/posts/post-119
http://example.com/blog/posts/post-120
http://example.com/blog/posts/post-121
http://example.com/blog/posts/post-122
http://example.com/blog/posts/post-123
http://example.com/blog/posts/post-124
http://example.com/blog/posts/post-125
http://example.com/blog/posts/post-126
http://example.com/blog/posts/post-127
http://example.com/blog/posts/post-128
http://example.com/blog/posts/post-129
http://example.com/blog/posts/post-130
http://example.com/blog/posts/post-131
http://example.com/blog/posts/post-132
http://example.com/blog/posts/post-133
http://example.com/blog/posts/post-134
http://example.com/blog/posts/post-135
http://example.com/blog/posts/post-136
http://example.com/blog/posts/post-137
http://example.com/blog/posts/post-138
http://example.com/blog/posts/post-139
http://example.com/blog/posts/post-140
http://example.com/blog/posts/post-141
http://example.com/blog/posts/post-142
http://example.com/blog/posts/post-143
http://example.com/blog/posts/post-144
http://example.com/blog/posts/post-145
http://example.com/blog/posts/post-146
http://example.com/blog/posts/post-147
http://example.com/blog/posts/post-148
http://example.com/blog/posts/post-149
http://example.com/blog/posts/post-150
http://example.com/blog/posts/post-151
http://example.com/blog/posts/post-152
http://example.com/blog/posts/post-153
http://example.com/blog/posts/post-154
http://example.com/blog/posts/post-155
http://example.com/blog/posts/post-156
http://example.com/blog/posts/post-157
http://example.com/blog/posts/post-158
http://example.com/blog/posts/post-159
http://example.com/blog/posts/post-160
http://example.com/blog/posts/post-161
http://example.com/blog/posts/post-162
http://example.com/blog/posts/post-163
http://example.com/blog/posts/post-164
http://example.com/blog/posts/post-165
http://example.com/blog/posts/post-166
http://example.com/blog/posts/post-167
http://example.com/blog/posts/post-168
http://example.com/blog/posts/post-169
http://example.com/blog/posts/post-170
http://example.com/blog/posts/post-171
http://example.com/blog/posts/post-172
http://example.com/blog/posts/post-173
http://example.com/blog/posts/post-174
http://example.com/blog/posts/post-175
http://example.com/blog/posts/post-176
http://example.com/blog/posts/post-177
http://example.com/blog/posts/post-178
http://example.com/blog/posts/post-179
http://example.com/blog/posts/post-180
http://example.com/blog/posts/post-181
http://example.com/blog/posts/post-182
http://example.com/blog/posts/post-183
http://example.com/blog/posts/post-184
http://example.com/blog/posts/post-185
http://example.com/blog/posts/post-186
http://example.com/blog/posts/post-187
http://example.com/blog/posts/post-188
http://example.com/blog/posts/post-189
http://example.com/blog/posts/post-190
http://example.com/blog/posts/post-191
http://example.com/blog/posts/post-192
http://example.com/blog/posts/post-193
http://example.com/blog/posts/post-194
http://example.com/blog/posts/post-195
http://example.com/blog/posts/post-196
http://example.com/blog/posts/post-197
http://example.com/blog/posts/post-198
http://example.com/blog/posts/post-199
Loading

0 comments on commit 2b6df2a

Please sign in to comment.