<?php

namespace App\Models;

use App\Concerns\HasTranslations;
use Illuminate\Database\Eloquent\Model;

class Service extends Model
{
    use HasTranslations;

    protected $table = 'service';

    protected $primaryKey = 'svc_id';

    protected string $columnPrefix = 'svc';

    const CREATED_AT = 'svc_created_at';

    const UPDATED_AT = 'svc_updated_at';

    protected $fillable = [
        'svph_id', 'svc_numero', 'svc_icone', 'svc_title_fr', 'svc_title_en',
        'svc_desc_fr', 'svc_desc_en', 'svc_exclusif', 'svc_ordre',
    ];

    protected $casts = ['svc_exclusif' => 'boolean'];

    public function phase()
    {
        return $this->belongsTo(ServicePhase::class, 'svph_id', 'svph_id');
    }
}
