despark / igni-seo
Igni CMS SEO Package
Installs: 1 213
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.4
- davechild/textstatistics: 1.*
- doctrine/dbal: ^2.5
- illuminate/support: 5.3.*|5.4.*|5.5.*
- wa72/htmlpagedom: 1.3.*
Requires (Dev)
README
Despark's igniCMS SEO Module for Laravle 5.3|5.4|5.5
Installation
-
Run
composer require despark/igni-seo
-
Add igniCMS SEO module service providers before the application service providers in the
config/app.php
, as shown below (Optional for Laravel 5.5)
Example
... /* * igniCMS Service Providers */ Despark\Cms\Seo\Providers\IgniSeoServiceProvider::class, /* * Package Service Providers... */ Laravel\Tinker\TinkerServiceProvider::class, ...
-
Run
php artisan vendor:publish --provider="Despark\Cms\Seo\Providers\IgniSeoServiceProvider"
. If you are using Laravel 5.3|5.4, replace--provider
with--class
. -
Run
php artisan migrate
to add our seo table to your database. -
In your entity file add the following code in your
adminFormsField
:
'content' => [ 'type' => 'wysiwyg', 'label' => 'Content', ], 'readability' => [ 'type' => 'readability', 'for' => 'content', // This field is optional. Use it only if your column, that is going to be checked for readability, is not called content 'editorPosition' => 0, // The position of the desired editor, if you have more than one wysiwygs ], 'seo' => [ 'type' => 'seo', 'routeName' => 'articles.show', 'meta_title_field' => 'title', // This field is optional. Use it only if your column, which is going to be checked is not called title ],
- Add our Traits and Interfaces to your Model.
use Despark\Cms\Admin\Interfaces\UploadImageInterface; use Despark\Cms\Admin\Traits\AdminImage; use Despark\Cms\Models\AdminModel; use Despark\Cms\Seo\Contracts\Seoable; use Despark\Cms\Seo\Traits\HasSeo; class Article extends AdminModel implements Seoable, UploadImageInterface { use HasSeo; use AdminImage; protected $table = 'articles'; protected $fillable = [ 'title', 'slug', 'content', ]; protected $rules = [ 'title' => 'required', 'slug' => 'required', 'content' => 'required', ]; protected $identifier = 'article'; }
Get your SEO data
$seoData = $model->seo;
Copyright and License
igniCMS was written by Despark for the Laravel framework and is released under the MIT License. See the LICENSE file for details.