- 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
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 runphp artisan admin:migrate:
config/admin.php
seo():
routes/web.php
/ 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, orAPP_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.
/, and the defaults of @metatags.