Download the PHP package archtechx/laravel-seo without Composer

On this page you can find all versions of the php package archtechx/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

Laravel SEO

This is a simple and extensible package for improving SEO via meta tags, such as OpenGraph tags.

By default, it uses <title> and OpenGraph tags. It also ships with a Twitter extension. You're, of course, free to write your own extensions as needed.

Features:

Example usage:

Installation

And add the following line to your layout file's <head> tag:

Usage

The package can be used from any PHP code, or specifically from Blade using the @seo directive.

PHP

Use the seo() helper to retrieve the SeoManager instance, on which you can call the following methods:

Available methods:

Example usage:

Blade views

You can use the @seo directive to call the methods from Blade:

In general, you'll want to use @seo(['title' => 'foo']) at the start of a view — to set the values — and @seo('title') inside the view if you wish to fetch the value.

That is, if you'll use the helpers in Blade at all. Some apps will only use the PHP helper.

For Twitter, use the twitter.author format, e.g. @seo('twitter.author').

Twitter

By default, no Twitter tags will be included. If you manually enable the extension by calling:

in a service provider for example, the extension will be enabled.

Once it's enabled, it will copy all default (OpenGraph) values and use them for the Twitter card schema.

When a value is set specifically for Twitter, it will be prioritized over the general fallback values.

Favicons

By default, no favicon links will be included. You can manually enable the extension by calling:

Generating favicons

To generate favicon, run:

from the artisan console. If no path argument is given we'll fallback to public/assets/logo.png.

We'll generate a 32x32px public/favicon.ico & public/favicon.png icon. This should be sufficient for most cases.

Please keep in mind that you need to install the imagick php extension and intervention/image composer package.

Defaults

To configure default values, call the methods with the default argument:

Extra tags

To add more tags to the document head, you can use the tag() and rawTag() methods:

Canonical URL

To enable the og:url and canonical URL link tags, call:

This will make the package read from request()->url() (the current URL without the query string).

If you wish to change the URL, call seo()->url():

Locale

To set the og:locale property:

Expected format is language_TERRITORY.

Modifiers

You may want to modify certain values before they get inserted into the template. For example, you may want to suffix the meta <title> with | ArchTech when it has a non-default value.

To do that, simply add the modify argument to the method calls like this:

You can, of course, combine these with the defaults:

Which will make the package use the default if no title is provided, and if a title is provided using e.g. seo()->title('Blog'), it will be modified right before being inserted into the template.

Flipp integration

First, you need to add your Flipp API keys:

  1. Add your API key to the FLIPP_KEY environment variable. You can get the key here.
  2. Go to config/services.php and add:

Then, register your templates, for example in AppServiceProvider:

After that, you can use the templates by calling seo()->flipp() like this:

The call will set the generated image as the OpenGraph and Twitter card images. The generated URLs are signed.

If no data array is provided, the method will use the title and description from the current SEO config:

The flipp() method also returns a signed URL to the image, which lets you use it in other places, such as blog cover images.

Previewify integration

First, you need to add your Previewify API keys:

  1. Add your API key to the PREVIEWIFY_KEY environment variable. You can get the key here.
  2. Go to config/services.php and add:

Then, register your templates, for example in AppServiceProvider:

After that, you can use the templates by calling seo()->previewify() like this:

The call will set the generated image as the OpenGraph and Twitter card images. The generated URLs are signed.

If no data array is provided, the method will use the title and description from the current SEO config:

The previewify() method also returns a signed URL to the image, which lets you use it in other places, such as blog cover images.

Note The previewify: prefix will be automatically prepended to all provided data keys.

Examples

Service Provider

This example sets the default state in a service provider's boot() method:

Controller

This example configures SEO metadata from a controller.

View

This example uses a Blade view that sets global SEO config using the values that are passed to the view.

Customization

This package is completely flexible, and can be customized either by having its views modified (to change the existing templates), or by you developing an extension (to add more templates).

Views

You can publish the Blade views by running php artisan vendor:publish --tag=seo-views.

Extensions

To use a custom extension, create a Blade component with the desired meta tags. The component should read data using {{ seo()->get('foo') }} or @seo('foo').

For example:

Once your view is created, register the extension:

To set data for an extension (in our case facebook), simply prefix calls with the extension name in camelCase, or use the ->set() method:

To disable an extension, set the second argument in the extension() call to false:

Development

Run all checks locally:

Code style will be automatically fixed by php-cs-fixer.


All versions of laravel-seo with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0
illuminate/view Version ^10.0|^11.0
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 archtechx/laravel-seo contains the following files

Loading the files please wait ....