Change sluggable implementation

This commit is contained in:
Jonny Barnes 2017-06-13 19:17:55 +01:00
parent e409cf68f9
commit 522f06162e
7 changed files with 285 additions and 58 deletions

View file

@ -4,18 +4,13 @@ namespace App;
use Illuminate\Database\Eloquent\Model;
use League\CommonMark\CommonMarkConverter;
use MartinBean\Database\Eloquent\Sluggable;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\SoftDeletes;
class Article extends Model
{
use SoftDeletes;
/*
* We want to turn the titles into slugs
*/
use Sluggable;
const DISPLAY_NAME = 'title';
const SLUG = 'titleurl';
use SoftDeletes;
/**
* The attributes that should be mutated to dates.
@ -31,6 +26,20 @@ class Article extends Model
*/
protected $table = 'articles';
/**
* Return the sluggable configuration array for this model.
*
* @return array
*/
public function sluggable()
{
return [
'titleurl' => [
'source' => 'title'
]
];
}
/**
* Define the relationship with webmentions.
*