<?php

namespace IqContent\LaravelFilemanager\Models;

use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;

class IQContentCategory extends Model
{
    use Sluggable;

    //use the connection to sec. Datebase sterntours
    protected $connection = 'mysql_stern';

    protected $table = 'i_q_content_categories';

    protected $fillable = [
        'name', 'pos', 'active'
    ];

    public function sluggable()
    {
        return [
            'slug' => [
                'source' => 'name'
            ]
        ];
    }


    public function tags() {
        return $this->hasMany('IqContent\LaravelFilemanager\Models\IQContentTag', 'category_id');
    }
}