Skip to content

Commit 65e194a

Browse files
Merge pull request #53 from ARCANEDEV/update-laravel_7
Updating the package to support Laravel 7
2 parents d3e41be + c07b472 commit 65e194a

23 files changed

+144
-120
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/SEO-Helper/re
2525
* Easy setup & configuration.
2626
* Well documented & IDE Friendly.
2727
* Well tested with maximum code quality.
28-
* Laravel `5.x | 6.x` are supported.
28+
* Laravel `5.x | 6.x | 7.x` are supported.
2929
* Made with :heart: & :coffee:.
3030

3131
## Table of contents

_docs/0-Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SEO Helper is a package that provides tools and helpers for SEO (Search Engine O
1111
* Easy setup & configuration.
1212
* Well documented & IDE Friendly.
1313
* Well tested with maximum code quality.
14-
* Laravel `5.x | 6.x` are supported.
14+
* Laravel `5.x | 6.x | 7.x` are supported.
1515
* Made with :heart: & :coffee:.
1616

1717
## Table of contents

_docs/1-Installation-and-Setup.md

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,37 @@
1212

1313
| SEO-Helper | Laravel |
1414
|:---------------------------------------|:---------------------------------------------------------------------------------------|
15-
| ![SEO-Helper v1.1.x][seo_helper_1_1_x] | ![Laravel v5.0][laravel_5_0] |
16-
| ![SEO-Helper v1.2.x][seo_helper_1_2_x] | ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] |
17-
| ![SEO-Helper v1.3.x][seo_helper_1_3_x] | ![Laravel v5.4][laravel_5_4] |
18-
| ![SEO-Helper v1.4.x][seo_helper_1_4_x] | ![Laravel v5.5][laravel_5_5] |
19-
| ![SEO-Helper v1.5.x][seo_helper_1_5_x] | ![Laravel v5.6][laravel_5_6] |
20-
| ![SEO-Helper v1.6.x][seo_helper_1_6_x] | ![Laravel v5.7][laravel_5_7] |
21-
| ![SEO-Helper v1.7.x][seo_helper_1_7_x] | ![Laravel v5.8][laravel_5_8] |
15+
| ![SEO-Helper v3.x][seo_helper_3_x] | ![Laravel v7.x][laravel_7_x] |
2216
| ![SEO-Helper v2.x][seo_helper_2_x] | ![Laravel v6.x][laravel_6_x] |
17+
| ![SEO-Helper v1.7.x][seo_helper_1_7_x] | ![Laravel v5.8][laravel_5_8] |
18+
| ![SEO-Helper v1.6.x][seo_helper_1_6_x] | ![Laravel v5.7][laravel_5_7] |
19+
| ![SEO-Helper v1.5.x][seo_helper_1_5_x] | ![Laravel v5.6][laravel_5_6] |
20+
| ![SEO-Helper v1.4.x][seo_helper_1_4_x] | ![Laravel v5.5][laravel_5_5] |
21+
| ![SEO-Helper v1.3.x][seo_helper_1_3_x] | ![Laravel v5.4][laravel_5_4] |
22+
| ![SEO-Helper v1.2.x][seo_helper_1_2_x] | ![Laravel v5.1][laravel_5_1] ![Laravel v5.2][laravel_5_2] ![Laravel v5.3][laravel_5_3] |
23+
| ![SEO-Helper v1.1.x][seo_helper_1_1_x] | ![Laravel v5.0][laravel_5_0] |
2324

24-
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
25-
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
26-
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
27-
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
28-
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"
29-
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
30-
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
31-
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
32-
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
25+
[laravel_7_x]: https://img.shields.io/badge/v7.x-supported-brightgreen.svg?style=flat-square "Laravel v7.x"
3326
[laravel_6_x]: https://img.shields.io/badge/v6.x-supported-brightgreen.svg?style=flat-square "Laravel v6.x"
27+
[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8"
28+
[laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7"
29+
[laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6"
30+
[laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5"
31+
[laravel_5_4]: https://img.shields.io/badge/v5.4-supported-brightgreen.svg?style=flat-square "Laravel v5.4"
32+
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
33+
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
34+
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
35+
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
3436

35-
[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "SEO-Helper v1.1.x"
36-
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "SEO-Helper v1.2.x"
37-
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "SEO-Helper v1.3.x"
38-
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "SEO-Helper v1.4.x"
39-
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.x-blue.svg?style=flat-square "SEO-Helper v1.5.x"
40-
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.x-blue.svg?style=flat-square "SEO-Helper v1.6.x"
41-
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.x-blue.svg?style=flat-square "SEO-Helper v1.7.x"
37+
[seo_helper_3_x]: https://img.shields.io/badge/version-3.x-blue.svg?style=flat-square "SEO-Helper v3.x"
4238
[seo_helper_2_x]: https://img.shields.io/badge/version-2.x-blue.svg?style=flat-square "SEO-Helper v2.x"
39+
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.x-blue.svg?style=flat-square "SEO-Helper v1.7.x"
40+
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.x-blue.svg?style=flat-square "SEO-Helper v1.6.x"
41+
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.x-blue.svg?style=flat-square "SEO-Helper v1.5.x"
42+
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "SEO-Helper v1.4.x"
43+
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "SEO-Helper v1.3.x"
44+
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "SEO-Helper v1.2.x"
45+
[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "SEO-Helper v1.1.x"
4346

4447
## Composer
4548

@@ -62,22 +65,6 @@ Once the package is installed, you can register the service provider in `config/
6265
],
6366
```
6467

65-
(**Optional**) And for the Facades:
66-
67-
```php
68-
// config/app.php
69-
70-
'aliases' => [
71-
...
72-
'SeoHelper' => Arcanedev\SeoHelper\Facades\SeoHelper::class,
73-
74-
// OR, by choosing a specific SEO Manager.
75-
'SeoMeta' => Arcanedev\SeoHelper\Facades\SeoMeta::class,
76-
'SeoOpenGraph' => Arcanedev\SeoHelper\Facades\SeoOpenGraph::class,
77-
'SeoTwitter' => Arcanedev\SeoHelper\Facades\SeoTwitter::class,
78-
];
79-
```
80-
8168
### Artisan commands
8269

8370
To publish the config file, run this command:

_docs/2-Configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ return [
2121

2222
'title' => [
2323
'default' => 'Default Title',
24-
'site-name' => config('app.name', 'My Application'),
24+
'site-name' => env('APP_NAME', 'Laravel'),
2525
'separator' => '-',
2626
'first' => true,
2727
'max' => 55,
@@ -55,7 +55,7 @@ return [
5555

5656
'misc' => [
5757
'canonical' => true,
58-
'robots' => config('app.env') !== 'production', // Tell robots not to index the content if it's not on production
58+
'robots' => env('APP_ENV', 'production') !== 'production', // Tell robots not to index the content if it's not on production
5959
'default' => [
6060
'viewport' => 'width=device-width, initial-scale=1', // Responsive design thing
6161
'author' => '', // https://plus.google.com/[YOUR PERSONAL G+ PROFILE HERE]

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"type": "library",
1818
"license": "MIT",
1919
"require": {
20-
"php": ">=7.2.0",
21-
"arcanedev/php-html": "^3.0",
22-
"arcanedev/support": "^5.1"
20+
"php": "^7.2.5",
21+
"arcanedev/php-html": "^4.0",
22+
"arcanedev/support": "^7.0"
2323
},
2424
"require-dev": {
2525
"ext-dom": "*",
26-
"orchestra/testbench": "^4.0",
27-
"phpunit/phpunit": "^8.0"
26+
"orchestra/testbench": "^5.0",
27+
"phpunit/phpunit": "^8.5|^9.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

src/Bases/MetaCollection.php renamed to src/Entities/AbstractMetaCollection.php

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Arcanedev\SeoHelper\Bases;
5+
namespace Arcanedev\SeoHelper\Entities;
66

77
use Arcanedev\SeoHelper\Contracts\Entities\MetaCollection as MetaCollectionContract;
88
use Arcanedev\SeoHelper\Contracts\Helpers\Meta as MetaContract;
@@ -16,7 +16,7 @@
1616
* @package Arcanedev\SeoHelper\Bases
1717
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1818
*/
19-
abstract class MetaCollection extends Collection implements MetaCollectionContract
19+
abstract class AbstractMetaCollection extends Collection implements MetaCollectionContract
2020
{
2121
/* -----------------------------------------------------------------
2222
| Properties
@@ -131,9 +131,9 @@ protected function addMeta($name, $content)
131131
*/
132132
public function remove($names)
133133
{
134-
return $this->forget(
135-
$this->prepareName($names)
136-
);
134+
$names = static::prepareName($names);
135+
136+
return $this->forget($names);
137137
}
138138

139139
/**
@@ -194,22 +194,6 @@ protected function isIgnored($name)
194194
| -----------------------------------------------------------------
195195
*/
196196

197-
/**
198-
* Remove an item from the collection by key.
199-
*
200-
* @param string|array $keys
201-
*
202-
* @return $this
203-
*/
204-
public function forget($keys)
205-
{
206-
foreach ((array) $keys as $key) {
207-
$this->offsetUnset($key);
208-
}
209-
210-
return $this;
211-
}
212-
213197
/**
214198
* Refresh meta collection items.
215199
*
@@ -229,7 +213,7 @@ private function refresh()
229213
*
230214
* @return array
231215
*/
232-
protected function prepareName($names)
216+
protected static function prepareName($names)
233217
{
234218
return array_map(function ($name) {
235219
return strtolower(trim($name));

src/Entities/Analytics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Arcanedev\SeoHelper\Entities;
66

77
use Arcanedev\SeoHelper\Contracts\Entities\Analytics as AnalyticsContract;
8-
use Arcanedev\Support\Traits\Configurable;
8+
use Arcanedev\SeoHelper\Traits\Configurable;
99

1010
/**
1111
* Class Analytics

src/Entities/Description.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Arcanedev\Html\Elements\Meta;
88
use Arcanedev\SeoHelper\Contracts\Entities\Description as DescriptionContract;
99
use Arcanedev\SeoHelper\Exceptions\InvalidArgumentException;
10-
use Arcanedev\Support\Traits\Configurable;
10+
use Arcanedev\SeoHelper\Traits\Configurable;
1111
use Illuminate\Support\Str;
1212

1313
/**

src/Entities/Keywords.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Arcanedev\Html\Elements\Meta;
88
use Arcanedev\SeoHelper\Contracts\Entities\Keywords as KeywordsContract;
9-
use Arcanedev\Support\Traits\Configurable;
9+
use Arcanedev\SeoHelper\Traits\Configurable;
1010

1111
/**
1212
* Class Keywords

src/Entities/MetaCollection.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44

55
namespace Arcanedev\SeoHelper\Entities;
66

7-
use Arcanedev\SeoHelper\Bases\MetaCollection as BaseMetaCollection;
87
use Arcanedev\SeoHelper\Helpers\Meta;
98

109
/**
1110
* Class MetaCollection
1211
*
13-
* @package Arcanedev\SeoHelper\Bases
12+
* @package Arcanedev\SeoHelper\Entities
1413
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
1514
*/
16-
class MetaCollection extends BaseMetaCollection
15+
class MetaCollection extends AbstractMetaCollection
1716
{
1817
/* -----------------------------------------------------------------
1918
| Properties

0 commit comments

Comments
 (0)