mirror of
https://github.com/devfake/flox.git
synced 2024-11-16 07:02:31 +01:00
26 lines
466 B
PHP
26 lines
466 B
PHP
|
<?php
|
||
|
|
||
|
namespace Flox;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Cviebrock\EloquentSluggable\SluggableInterface;
|
||
|
use Cviebrock\EloquentSluggable\SluggableTrait;
|
||
|
|
||
|
class Item extends Model implements SluggableInterface
|
||
|
{
|
||
|
|
||
|
use SluggableTrait;
|
||
|
|
||
|
protected $sluggable = [
|
||
|
'build_from' => 'title',
|
||
|
'save_to' => 'slug',
|
||
|
];
|
||
|
|
||
|
public $timestamps = false;
|
||
|
|
||
|
public function categories()
|
||
|
{
|
||
|
return $this->belongsTo('Flox\Category', 'category_id');
|
||
|
}
|
||
|
}
|