Download the PHP package esign/laravel-seo without Composer
On this page you can find all versions of the php package esign/laravel-seo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download esign/laravel-seo
More information about esign/laravel-seo
Files in esign/laravel-seo
Package laravel-seo
Short Description Manage SEO tags within your Laravel application
License MIT
Informations about the package laravel-seo
Manage SEO tags within your Laravel application
This package allows you to render SEO related HTML tags that can be set from anywhere in your application. Currently Meta, Open Graph, Twitter Card and JsonLD are supported. It also ships with some handy ways to configure SEO for your Eloquent models.
Installation
You can install the package via composer:
The package will automatically register a service provider.
Next up, you can publish the configuration file:
The config file will be published as config/seo.php
with the following content:
Usage
Preparing your HTML
You may start off by including the seo views in the head of your HTML:
In case you want to customize these views, you may publish them using the following command:
Setting attributes
To quickly set up some SEO attributes, you may use the Seo class. This is usually done from the controller, but that shouldn't limit you from using it in other places:
The SEO class will forward these to all the underlying tags. In case you want some more fine grained control over what attributes are being set you may use the individual tags:
You can also use a fluent API that allows you to chain methods:
Defining mutators
This package allows you to define mutators like Laravel's model attributes:
A setTitleAttribute
has been included on all traits that will suffix your title with your app name:
To bypass a mutator while setting an attribute, you may use the setRaw
method:
Setting SEO for models
To set SEO for models, you may implement the Esign\Seo\Contracts\SeoContract
interface.
A handy trait Esign\Seo\Concerns\HasSeoDefaults
has been included that can quickly help you set up some SEO defaults for your model.
This however is not necessary, you could also implement the methods yourself:
You may set this SeoContract
using the set
method:
Seo API
Meta API
Open Graph API
Twitter Card API
JsonLd API
This package also ships with a nice helper method that you may use as an alternative to the facade:
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-seo with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
spatie/schema-org Version ^3.0