The website package fills the meta tags of every page from three sources:
  • the meta tag fields of a model, added with $seo
  • the SEO routes module of the administration, where administrators set meta tags of any url
  • values set in the Blade views

Meta tags of models

app/Models/Article.php
$seo adds the Meta tags tab with the title, keywords, description, canonical url and images. The options are described in Pretty URLs and SEO. Pass the model to the SEO of the page in its view:
resources/views/articles/show.blade.php
Without meta tag fields, the model name, description and image are used. The title is read from meta_title, name, title or username, the description from meta_description, description or content, and the image from meta_image, image, images or avatar.

SEO of routes

Enable the module and run php artisan admin:migrate:
config/admin.php
Mark the GET routes which administrators may describe with seo():
routes/web.php
The SEO routes module in the Settings group lists these routes the next time an administrator opens it. The row of the / url is the default of the whole website. Routes of one group share one row, e.g. all articles of a blog. Select the group of a page in its view:

Setting values in views

resources/views/contact.blade.php

Rendering meta tags

Render the tags in the <head> of the layout. The array is the default of pages without their own values:
resources/views/layouts/app.blade.php
@metatags renders <title>, the description, keywords and author, the Open Graph and Twitter tags and the canonical url.
  • The title is {page title} {seo.separator} {website title}. The website title is the default title, or APP_NAME.
  • Descriptions and keywords are stripped of HTML and shortened to 300 characters.
  • Uploaded images are resized to 1200 × 630.
  • Values of the SEO routes module match urls with and without a language prefix.
The values are looked up in this order: the SEO route of the current url, values set in the view, the fields of the model, the SEO route of the route or group, the row of /, and the defaults of @metatags.

SEO facade

Read the values anywhere else, e.g. in a view of an error page: