Skip to content

Commit

Permalink
Merge Pull Request #102 Configurable Tagged model #102
Browse files Browse the repository at this point in the history
  • Loading branch information
rtconner committed Sep 12, 2016
1 parent 71fdc9a commit 4f56cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions config/tagging.php
@@ -1,7 +1,6 @@
<?php

return array(

return [
// Datatype for primary keys of your models.
// used in migrations only
'primary_keys_type' => 'integer', // 'string' or 'integer'
Expand All @@ -26,4 +25,7 @@

// Delimiter used within tags
'delimiter' => '-',
);

// Model to use for the relation between tags and tagged records
'tagged_model' => '\Conner\Tagging\Model\Tagged',
];
2 changes: 1 addition & 1 deletion src/Taggable.php
Expand Up @@ -59,7 +59,7 @@ public static function bootTaggable()
*/
public function tagged()
{
return $this->morphMany('Conner\Tagging\Model\Tagged', 'taggable')->with('tag');
return $this->morphMany(config('tagging.tagged_model', 'Conner\Tagging\Model\Tagged'), 'taggable')->with('tag');
}

/**
Expand Down

0 comments on commit 4f56cf9

Please sign in to comment.