<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Segment
 * @package App\Models
 *
 * @property string $name
 * @property string $reference
 */
class Segment extends AbstractModel
{
    use SoftDeletes;

    protected $table = 'segments';

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'deleted_at' => 'datetime',
        ];
    }

    /**
     * @return HasMany
     */
    public function constants(): HasMany
    {
        return $this->HasMany(SegmentConstant::class, 'segment_id', 'id');
    }
}
