Skip to content

Commit

Permalink
Merge pull request #53 from ARCANEDEV/update-laravel_7
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 d3e41be + c07b472 commit 65e194a
Show file tree
Hide file tree
Showing 23 changed files with 144 additions and 120 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/SEO-Helper/re
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `5.x | 6.x` are supported.
* Laravel `5.x | 6.x | 7.x` are supported.
* Made with :heart: & :coffee:.

## Table of contents
Expand Down
2 changes: 1 addition & 1 deletion _docs/0-Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SEO Helper is a package that provides tools and helpers for SEO (Search Engine O
* Easy setup & configuration.
* Well documented & IDE Friendly.
* Well tested with maximum code quality.
* Laravel `5.x | 6.x` are supported.
* Laravel `5.x | 6.x | 7.x` are supported.
* Made with :heart: & :coffee:.

## Table of contents
Expand Down
65 changes: 26 additions & 39 deletions _docs/1-Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,37 @@

| SEO-Helper | Laravel |
|:---------------------------------------|:---------------------------------------------------------------------------------------|
| ![SEO-Helper v1.1.x][seo_helper_1_1_x] | ![Laravel v5.0][laravel_5_0] |
| ![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] |
| ![SEO-Helper v1.3.x][seo_helper_1_3_x] | ![Laravel v5.4][laravel_5_4] |
| ![SEO-Helper v1.4.x][seo_helper_1_4_x] | ![Laravel v5.5][laravel_5_5] |
| ![SEO-Helper v1.5.x][seo_helper_1_5_x] | ![Laravel v5.6][laravel_5_6] |
| ![SEO-Helper v1.6.x][seo_helper_1_6_x] | ![Laravel v5.7][laravel_5_7] |
| ![SEO-Helper v1.7.x][seo_helper_1_7_x] | ![Laravel v5.8][laravel_5_8] |
| ![SEO-Helper v3.x][seo_helper_3_x] | ![Laravel v7.x][laravel_7_x] |
| ![SEO-Helper v2.x][seo_helper_2_x] | ![Laravel v6.x][laravel_6_x] |
| ![SEO-Helper v1.7.x][seo_helper_1_7_x] | ![Laravel v5.8][laravel_5_8] |
| ![SEO-Helper v1.6.x][seo_helper_1_6_x] | ![Laravel v5.7][laravel_5_7] |
| ![SEO-Helper v1.5.x][seo_helper_1_5_x] | ![Laravel v5.6][laravel_5_6] |
| ![SEO-Helper v1.4.x][seo_helper_1_4_x] | ![Laravel v5.5][laravel_5_5] |
| ![SEO-Helper v1.3.x][seo_helper_1_3_x] | ![Laravel v5.4][laravel_5_4] |
| ![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] |
| ![SEO-Helper v1.1.x][seo_helper_1_1_x] | ![Laravel v5.0][laravel_5_0] |

[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
[laravel_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
[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.x"
[laravel_6_x]: https://img.shields.io/badge/v6.x-supported-brightgreen.svg?style=flat-square "Laravel v6.x"
[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_5_3]: https://img.shields.io/badge/v5.3-supported-brightgreen.svg?style=flat-square "Laravel v5.3"
[laravel_5_2]: https://img.shields.io/badge/v5.2-supported-brightgreen.svg?style=flat-square "Laravel v5.2"
[laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1"
[laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0"

[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "SEO-Helper v1.1.x"
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "SEO-Helper v1.2.x"
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "SEO-Helper v1.3.x"
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "SEO-Helper v1.4.x"
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.x-blue.svg?style=flat-square "SEO-Helper v1.5.x"
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.x-blue.svg?style=flat-square "SEO-Helper v1.6.x"
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.x-blue.svg?style=flat-square "SEO-Helper v1.7.x"
[seo_helper_3_x]: https://img.shields.io/badge/version-3.x-blue.svg?style=flat-square "SEO-Helper v3.x"
[seo_helper_2_x]: https://img.shields.io/badge/version-2.x-blue.svg?style=flat-square "SEO-Helper v2.x"
[seo_helper_1_7_x]: https://img.shields.io/badge/version-1.7.x-blue.svg?style=flat-square "SEO-Helper v1.7.x"
[seo_helper_1_6_x]: https://img.shields.io/badge/version-1.6.x-blue.svg?style=flat-square "SEO-Helper v1.6.x"
[seo_helper_1_5_x]: https://img.shields.io/badge/version-1.5.x-blue.svg?style=flat-square "SEO-Helper v1.5.x"
[seo_helper_1_4_x]: https://img.shields.io/badge/version-1.4.x-blue.svg?style=flat-square "SEO-Helper v1.4.x"
[seo_helper_1_3_x]: https://img.shields.io/badge/version-1.3.x-blue.svg?style=flat-square "SEO-Helper v1.3.x"
[seo_helper_1_2_x]: https://img.shields.io/badge/version-1.2.x-blue.svg?style=flat-square "SEO-Helper v1.2.x"
[seo_helper_1_1_x]: https://img.shields.io/badge/version-1.1.x-blue.svg?style=flat-square "SEO-Helper v1.1.x"

## Composer

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

(**Optional**) And for the Facades:

```php
// config/app.php

'aliases' => [
...
'SeoHelper' => Arcanedev\SeoHelper\Facades\SeoHelper::class,

// OR, by choosing a specific SEO Manager.
'SeoMeta' => Arcanedev\SeoHelper\Facades\SeoMeta::class,
'SeoOpenGraph' => Arcanedev\SeoHelper\Facades\SeoOpenGraph::class,
'SeoTwitter' => Arcanedev\SeoHelper\Facades\SeoTwitter::class,
];
```

### Artisan commands

To publish the config file, run this command:
Expand Down
4 changes: 2 additions & 2 deletions _docs/2-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return [

'title' => [
'default' => 'Default Title',
'site-name' => config('app.name', 'My Application'),
'site-name' => env('APP_NAME', 'Laravel'),
'separator' => '-',
'first' => true,
'max' => 55,
Expand Down Expand Up @@ -55,7 +55,7 @@ return [

'misc' => [
'canonical' => true,
'robots' => config('app.env') !== 'production', // Tell robots not to index the content if it's not on production
'robots' => env('APP_ENV', 'production') !== 'production', // Tell robots not to index the content if it's not on production
'default' => [
'viewport' => 'width=device-width, initial-scale=1', // Responsive design thing
'author' => '', // https://plus.google.com/[YOUR PERSONAL G+ PROFILE HERE]
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"type": "library",
"license": "MIT",
"require": {
"php": ">=7.2.0",
"arcanedev/php-html": "^3.0",
"arcanedev/support": "^5.1"
"php": "^7.2.5",
"arcanedev/php-html": "^4.0",
"arcanedev/support": "^7.0"
},
"require-dev": {
"ext-dom": "*",
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0"
"orchestra/testbench": "^5.0",
"phpunit/phpunit": "^8.5|^9.0"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Bases;
namespace Arcanedev\SeoHelper\Entities;

use Arcanedev\SeoHelper\Contracts\Entities\MetaCollection as MetaCollectionContract;
use Arcanedev\SeoHelper\Contracts\Helpers\Meta as MetaContract;
Expand All @@ -16,7 +16,7 @@
* @package Arcanedev\SeoHelper\Bases
* @author ARCANEDEV <[email protected]>
*/
abstract class MetaCollection extends Collection implements MetaCollectionContract
abstract class AbstractMetaCollection extends Collection implements MetaCollectionContract
{
/* -----------------------------------------------------------------
| Properties
Expand Down Expand Up @@ -131,9 +131,9 @@ protected function addMeta($name, $content)
*/
public function remove($names)
{
return $this->forget(
$this->prepareName($names)
);
$names = static::prepareName($names);

return $this->forget($names);
}

/**
Expand Down Expand Up @@ -194,22 +194,6 @@ protected function isIgnored($name)
| -----------------------------------------------------------------
*/

/**
* Remove an item from the collection by key.
*
* @param string|array $keys
*
* @return $this
*/
public function forget($keys)
{
foreach ((array) $keys as $key) {
$this->offsetUnset($key);
}

return $this;
}

/**
* Refresh meta collection items.
*
Expand All @@ -229,7 +213,7 @@ private function refresh()
*
* @return array
*/
protected function prepareName($names)
protected static function prepareName($names)
{
return array_map(function ($name) {
return strtolower(trim($name));
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Arcanedev\SeoHelper\Entities;

use Arcanedev\SeoHelper\Contracts\Entities\Analytics as AnalyticsContract;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;

/**
* Class Analytics
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Arcanedev\Html\Elements\Meta;
use Arcanedev\SeoHelper\Contracts\Entities\Description as DescriptionContract;
use Arcanedev\SeoHelper\Exceptions\InvalidArgumentException;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;
use Illuminate\Support\Str;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Arcanedev\Html\Elements\Meta;
use Arcanedev\SeoHelper\Contracts\Entities\Keywords as KeywordsContract;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;

/**
* Class Keywords
Expand Down
5 changes: 2 additions & 3 deletions src/Entities/MetaCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

namespace Arcanedev\SeoHelper\Entities;

use Arcanedev\SeoHelper\Bases\MetaCollection as BaseMetaCollection;
use Arcanedev\SeoHelper\Helpers\Meta;

/**
* Class MetaCollection
*
* @package Arcanedev\SeoHelper\Bases
* @package Arcanedev\SeoHelper\Entities
* @author ARCANEDEV <[email protected]>
*/
class MetaCollection extends BaseMetaCollection
class MetaCollection extends AbstractMetaCollection
{
/* -----------------------------------------------------------------
| Properties
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/MiscTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Arcanedev\SeoHelper\Entities;

use Arcanedev\SeoHelper\Contracts\Entities\MiscTags as MiscTagsContract;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;

/**
* Class MiscTags
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/OpenGraph/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Arcanedev\SeoHelper\Entities\OpenGraph;

use Arcanedev\SeoHelper\Contracts\Entities\OpenGraph as OpenGraphContract;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;

/**
* Class Graph
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/OpenGraph/MetaCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Arcanedev\SeoHelper\Entities\OpenGraph;

use Arcanedev\SeoHelper\Bases\MetaCollection as BaseMetaCollection;
use Arcanedev\SeoHelper\Entities\AbstractMetaCollection;

/**
* Class MetaCollection
*
* @package Arcanedev\SeoHelper\Entities\OpenGraph
* @author ARCANEDEV <[email protected]>
*/
class MetaCollection extends BaseMetaCollection
class MetaCollection extends AbstractMetaCollection
{
/* -----------------------------------------------------------------
| Properties
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Arcanedev\Html\Elements\Element;
use Arcanedev\SeoHelper\Contracts\Entities\Title as TitleContract;
use Arcanedev\SeoHelper\Exceptions\InvalidArgumentException;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;
use Illuminate\Support\Str;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Twitter/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Arcanedev\SeoHelper\Contracts\Entities\TwitterCard as CardContract;
use Arcanedev\SeoHelper\Exceptions\InvalidTwitterCardException;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;
use Illuminate\Support\Str;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Entities/Twitter/MetaCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Arcanedev\SeoHelper\Entities\Twitter;

use Arcanedev\SeoHelper\Bases\MetaCollection as BaseMetaCollection;
use Arcanedev\SeoHelper\Entities\AbstractMetaCollection;

/**
* Class MetaCollection
*
* @package Arcanedev\SeoHelper\Entities\Twitter
* @author ARCANEDEV <[email protected]>
*/
class MetaCollection extends BaseMetaCollection
class MetaCollection extends AbstractMetaCollection
{
/* -----------------------------------------------------------------
| Properties
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Webmasters.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Arcanedev\SeoHelper\Entities;

use Arcanedev\SeoHelper\Contracts\Entities\Webmasters as WebmastersContract;
use Arcanedev\Support\Traits\Configurable;
use Arcanedev\SeoHelper\Traits\Configurable;

/**
* Class Webmasters
Expand Down
Loading

0 comments on commit 65e194a

Please sign in to comment.