Skip to content

Releases: romanzipp/Laravel-SEO

v2.6.0

27 Oct 19:10
Compare
Choose a tag to compare

Changes


EmbedX is a new project I founded with some friends which allows you to generate rich preview thumbnails for X/Twitter.

v2.2.0

13 Jan 08:20
Compare
Choose a tag to compare

Added sections feature. See docs for more information

v2.1.0

12 Oct 08:50
Compare
Choose a tag to compare

Added addFromArray method to allow settings SEO values from nested array. See docs for more information

v2.0.0

11 Mar 17:25
Compare
Choose a tag to compare

Upgrading from 1.0 to 2.0

SeoService

The clear Method

The clear method has been renamed to a more consistent clearStructs method.

- seo()->clear();
+ seo()->clearStructs();

The render Method

The render method now returns a RenderConductor which implements the Renderable, Htmlable and Arrayable interfaces instead of a HtmlString.

/** @var $content string */
- $content = (string) seo()->render();
+ $content = seo()->render()->toHtml();

You can still use {{ seo()->render() }} in Blade templates.

/** @var $content array */
- $content = seo()->renderContentsArray();
+ $content = seo()->render()->toArray();
/** @var $content Illuminate\Support\HtmlString */
- $content = seo()->render();
+ $content = seo()->render()->build();

Structs

The defaults Method

The romanzipp\Seo\Structs\Struct::defaults() method now has a return type of void.

class CustomStruct extends Struct
{
-   public static function defaults(Struct $struct)
+   public static function defaults(Struct $struct): void
    {
        $struct->addAttribute('name', 'custom');
    }
}

Fluent Setters

All fluent setter methods now share the same return type of romanzipp\Seo\Structs\Struct.

use romanzipp\Seo\Structs\Struct;

class CustomStruct extends Meta
{
-   public function property($value = null, bool $escape = true): self
+   public function property($value = null, bool $escape = true): Struct
    {
        $this->addAttribute('property', 'custom:' . $value, $escape);

        return $this;
    }
}

Laravel-Mix

The filter and reject Methods

Both filter and reject methods in the Laravel-Mix integration have been replaced with a more general map method.

seo()
    ->mix()
-   ->filter(function ($path, $url) {
-       // ...
-   })
-   ->reject(function ($path, $url) {
-       // ...
-   });
+   ->map(static function (ManifestAsset $asset): ?ManifestAsset {
+       // ...
+   });

The rel Method

The rel setter for the Laravel-Mix integration has been removed.

seo()
    ->mix()
-   ->rel('preload');
+   ->map(static function (ManifestAsset $asset): ?ManifestAsset {
+       $asset->rel = 'preload';
+       return $asset;
+   });

The getAssets Method

The MixManifestConductor::getAssets() method now returns an array of type ManifestAsset[].

v1.2.0

03 Mar 14:17
Compare
Choose a tag to compare

Laravel 7 support

v1.0.3

28 Apr 09:59
Compare
Choose a tag to compare

v1.0.2

07 Apr 16:03
Compare
Choose a tag to compare
  • Add bool $escape = true parameter to all struct setter methods

v1.0.1

04 Apr 20:38
Compare
Choose a tag to compare
  • Add seo()->meta() shorthand method
  • Simplify Readme Examples
  • Enhance various docs

v1.0.0

28 Feb 17:03
Compare
Choose a tag to compare
  • Initial stable release
  • Add Laravel 5.8 Support
  • Add consistent attribute values & body escaping