eandraos/gaia-seo

Add SEO and sharing tags to pages/modules in the Gaia CMS

1.0.4 2015-08-06 12:24 UTC

This package is not auto-updated.

Last update: 2020-07-10 19:11:59 UTC


README

Adds seo model with ability to polymorphic relation with other models (news, page ...). The package will publish the following:

  • views (a form partial)
  • migrations (in database folder)
  • models

Installation

Run the following command in your terminal

composer require eandraos/gaia-seo

Then register this service provider with Laravel in config/app.php

Gaia\Seo\GaiaSeoServiceProvider

Publish the different files

php artisan vendor:publish

Usage

add the polymorphic relation in another model

// ... in News model for example  

public function seoable()
{
	return $this->morphTo();
}

in controller method (to add a news with its seo tags)

$seo = new Seo;
$seo->updateFromInput($input); //method in model that will save the input (form partial)
$news->seo()->save($seo);