Change sluggable implementation
This commit is contained in:
parent
e409cf68f9
commit
522f06162e
7 changed files with 285 additions and 58 deletions
|
@ -6,18 +6,13 @@ use DB;
|
|||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
use MartinBean\Database\Eloquent\Sluggable;
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Phaza\LaravelPostgis\Eloquent\PostgisTrait;
|
||||
|
||||
class Place extends Model
|
||||
{
|
||||
use PostgisTrait;
|
||||
/*
|
||||
* We want to turn the names into slugs.
|
||||
*/
|
||||
use Sluggable;
|
||||
const DISPLAY_NAME = 'name';
|
||||
const SLUG = 'slug';
|
||||
use PostgisTrait;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
|
@ -36,6 +31,20 @@ class Place extends Model
|
|||
'polygon',
|
||||
];
|
||||
|
||||
/**
|
||||
* Return the sluggable configuration array for this model.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the relationship with Notes.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue