<?php

namespace Modules\Admin\App\Models\Sat;

use Illuminate\Database\Eloquent\Model;

class RegimenFiscal extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'sat_regimen_fiscal';


    /**
     * The attributes that are mass assignable.
     *
     * @var string[]
     */
    protected $fillable = [
        'c_regimen_fiscal',
        'descripcion',
        'fisica',
        'moral',
        'fecha_de_inicio_de_vigencia',
        'fecha_de_fin_de_vigencia',
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'fecha_de_inicio_de_vigencia' => 'datetime',
        'fecha_de_fin_de_vigencia' => 'datetime',
    ];

    public static function selectList()
    {
        return self::selectRaw('c_regimen_fiscal, CONCAT(c_regimen_fiscal, " - ", descripcion) as value')
            ->pluck('value', 'c_regimen_fiscal');
    }
}
