Skip to content

Create meta tags/keywords and relate them to other tables via polymorphic relation

Notifications You must be signed in to change notification settings

Surfpup/LaravelKeywords

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaravelKeywords

Create meta tags/keywords and relate them to other tables via a polymorphic relationship.

Installation (WIP)

For the moment, not published as a composer package, so

  • place (in your project folder) at: workbench/surfpup/keywords
  • Add 'Surfpup\Keywords\KeywordsServiceProvider' to app/config/app.php
  • Run composer update

Then to run tests, run: phpunit workbench/surfpup/keywords/

For any model that you wish to assign keywords to, simply extend the KeywordObject model class, and use the following methods:

KeywordObject methods

  • addKeyword($word) - Assign a keyword
  • addKeywords($words) - Assign multiple keywords (with an array or comma-separated string)
  • keywords - The relationship method which accesses KeywordMap objects
  • getKeywordNames() - Returns an array of keyword names
  • getKeywords() - Returns an array of KeywordMap objects joined with the keyword name

About

Create meta tags/keywords and relate them to other tables via polymorphic relation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages