<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Cviebrock\EloquentSluggable\Sluggable;
use Krnos\Fire\HasChanges;
use Spatie\Tags\HasTags;

class Post extends Model
{
use HasChanges, HasTags, Sluggable;

  /**
   * The state's page.
   */
  const POST_LIVE = 'live';
  const POST_DRAFT = 'draft';
  const POST_ARCHIVED = 'archived';

  /**
   * Get the model's label in fire.
   *
   * @return string
   */
  public function getModelLabel()
  {
    return $this->name;
  }

  /**
   * Return the sluggable configuration array for this model.
   *
   * @return array
   */
  public function sluggable()
  {
      return [
          'slug' => [
              'source' => 'name'
          ]
      ];
  }
}
