Download the PHP package honeystone/laravel-seo without Composer

On this page you can find all versions of the php package honeystone/laravel-seo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-seo

Honeystone SEO Configurator for Laravel

Static Badge GitHub License Latest Version on Packagist Packagist Dependency Version Packagist Dependency Version Static Badge

The Honeystone SEO package makes configuring SEO metadata from anywhere within your Laravel application a breeze.

Included are metadata generators for general metadata, X (Formally Twitter) Cards, Open Graph and JSON-LD Schema.

This package was designed with extensibility in mind, so your own custom metadata generators can also be added with ease.

Support us

Support Us

We are committed to delivering high-quality open source packages maintained by the team at Honeystone. If you would like to support our efforts, simply use our packages, recommend them and contribute.

If you need any help with your project, or require any custom development, please get in touch.

Installation

Publish the configuration file with:

Usage

The package provides a helper function, seo(), and some Blade directives, @metadata and @openGraphPrefix. You can also typehint the Honeystone\Seo\MetadataDirector if you prefer to use dependency injection.

Setting metadata is a simple as chaining methods:

Once you've set your metadata, you can render it using:

Alternatively, you can also use the @metadata Blade directive.

The rendered result will look something like this:

Default methods

Values provided to default methods will automatically propagate to all configured metadata generators.

The following default methods are available:

The full baseline looks like this:

For your homepage you'll probably want to disable the title template:

Meta methods

The meta methods are provided by the Honeystone\Seo\Generators\MetaGenerator class.

Here's the full list:

All of these are provided by the default methods and propagate through to the meta generator.

If you only want to render the meta generator, use seo()->generate('meta') or @metadata('meta')

Twitter methods

The meta methods are provided by the Honeystone\Seo\Generators\TwitterGenerator class.

Here's the full list:

Open Graph methods

The meta methods are provided by the Honeystone\Seo\Generators\TwitterGenerator class.

Here's the full list:

You can also use the following non-vertical supported types:

You can provide more data for images, audio and videos using their respective properties classes:

Here's an example using ArticleProperties and ImageProperties:

To set the prefix, you can use the @openGraphPrefix Blade directive or seo()->openGraphPrefix() like so:

JSON-LD methods

The meta methods are provided by the Honeystone\Seo\Generators\JsonLdGenerator class.

Here's the full list:

And the output:

But Wait, There's More!

Rather than reinventing the wheel, this package has support for the incredible spatie/schema-org package. You can use the jsonLdImport() method to import an exising schema, or build your schema using the fluent interface.

Just don't forget to install the spatie/schema-org package to use this functionality.

Expectations / Check Ins

It's highly likely you'll be building your graph from many locations around your application, e.g. middleware, controllers, view composers, view components, etc.

This is where expectations come in. Simply specify your expectations, and then ensure the other parts of your application check in. If something failed to check in, an exception will be thrown. Conversely, if something unexpected checked in, an exception will also be thrown.

You'll be warned immediately if 'featured-tags' or 'contact' fail to check in.

This feature is entirely optional. Just don't set any expectations, or check in, and no exceptions will be thrown.

Model integration

This package doesn't include any specific functionality for integrating models. Ultimately, you'll always need to map your model attributes to this package. For example, if your model has a meta_description attribute, you will need to map it to description, otherwise this package would not know to consume it.

With this in mind, we have a simple pattern that should get you what you need.

Start by adding a new method to your model, and set your metadata using the model's attributes within:

Then in your controller, just call the method and chain any additional metadata:

Custom generators

To create a custom generator, simply implement the Honeystone\Seo\Contracts\MetadataGenerator contract and add it to your config file in the generators section. You can specify any configuration for your generator here too.

Removing the source comments

The package includes comments in the generated HTML. If you would like to remove them, you can publish the views and remove the comments from the Blade files:

Publishing the package views is generally not recommended as these files will not be updated when the package is updated. If it is absolutely necessary to publish the views, we recommend only publishing the files you need to modify.

Configuration

Here's the full config file:

Changelog

A list of changes can be found in the CHANGELOG.md file.

License

Honeystone Consulting Ltd


All versions of laravel-seo with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-zip Version *
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.16.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package honeystone/laravel-seo contains the following files

Loading the files please wait ....