<?php

namespace App;

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

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

  /**
   * The state's page.
   */
  const PAGE_LIVE = 'live';
  const PAGE_DRAFT = 'draft';
  const PAGE_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'
          ]
      ];
  }
}
