Download the PHP package iki/seo-meta without Composer
On this page you can find all versions of the php package iki/seo-meta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package seo-meta
SEO meta field nova
This is a fork from the original package but has more features and updated to Nova4
This custom nova field, can add SEO related fields to any Model through a morph relationship within one single trait.
if you are upgrading from v1 please read the upgrade guide
How to install
To install the package run the install below:
And then publish the configs and migrations :
And then run the migrations:
How to use the field
Find the model you want to have the SEO fields on, example could be App\Models\Page
, then add the SeoMetaTrait
trait:
Then use the field in the nova resource App\Nova\Page
:
Then go to the top of your layout blade as default it's resources/views/welcome.blade.php
:
Where the @include('seo-meta::seo', ['page' => $page])
, should have the model instance with the relation to
the SeoMetaTrait
trait.
If you dont have any selected model/resource on the current page, then get the given SEO data for the page like this:
Here is how the Seo::renderAttributes
static method looks like:
Localization
- for localization just update the config file with the available locales and the fallback locale
Setup default values for a model
If the SEO values should have the same structure every time, then you are able to set the up with the following methods in the trait:
Setup Sitemap functionality
If you want the sitemap functionality then activate the sitemap by changing the seo.sitemap_status
config to true
.
Then add the models which has the SeoSitemapTrait
trait to the seo.sitemap_models
array, like this:
Add Sitemap trait to models
When you want the eloquent model to be shown in the sitemap then you need to add the SeoSitemapTrait
trait to it:
Know you should be able to go to the seo.sitemap_path
which is /sitemap
as default. Then you should get an xml in
the correct sitemap structure for Google Search Console.