SEO package made for maximum customization and flexibility
MIT License
Bot releases are visible (Hide)
Published by romanzipp almost 4 years ago
Added sections feature. See docs for more information
Published by romanzipp about 4 years ago
Added addFromArray
method to allow settings SEO values from nested array. See docs for more information
Published by romanzipp over 4 years ago
clear
MethodThe clear
method has been renamed to a more consistent clearStructs
method.
- seo()->clear();
+ seo()->clearStructs();
render
MethodThe 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();
defaults
MethodThe 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');
}
}
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;
}
}
filter
and reject
MethodsBoth 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 {
+ // ...
+ });
rel
MethodThe 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;
+ });
getAssets
MethodThe MixManifestConductor::getAssets()
method now returns an array of type ManifestAsset[]
.
Published by romanzipp over 4 years ago
Laravel 7 support
Published by romanzipp over 5 years ago
Published by romanzipp over 5 years ago
bool $escape = true
parameter to all struct setter methodsPublished by romanzipp over 5 years ago
seo()->meta()
shorthand methodPublished by romanzipp over 5 years ago