<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Kalnoy\Nestedset\NodeTrait;

/**
 * Class Category
 *
 * @property int $id
 * @property string $name
 * @property string|null $emoji
 * @property string|null $slug
 * @property string|null $description
 * @property bool $enabled
 * @property bool $is_top
 * @property int $_lft
 * @property int $_rgt
 * @property int|null $parent_id
 * @property string|null $deleted_at
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 */
class Category extends Model
{
    use NodeTrait, SoftDeletes;

    protected $table = 'categories';

    protected $casts = [
        'enabled' => 'bool',
        'is_top' => 'bool',
        '_lft' => 'int',
        '_rgt' => 'int',
        'parent_id' => 'int',
    ];

    protected $fillable = [
        'name',
        'emoji',
        'slug',
        'description',
        'enabled',
        'is_top',
        '_lft',
        '_rgt',
        'parent_id',
    ];
}
