Change sluggable implementation
This commit is contained in:
parent
e409cf68f9
commit
522f06162e
7 changed files with 285 additions and 58 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue