48 lines
983 B
PHP
Raw Normal View History

2025-01-27 02:22:06 -06:00
<?php
namespace Modules\Admin\App\Models\Sat;
use Illuminate\Database\Eloquent\Model;
class Estado extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'sat_estado';
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'c_estado',
'c_pais',
'nombre_del_estado',
'fecha_inicio_de_vigencia',
'fecha_fin_de_vigencia',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'fecha_inicio_de_vigencia' => 'datetime',
'fecha_fin_de_vigencia' => 'datetime',
];
public static function selectList($pais = 'MEX')
{
return self::select('c_estado', 'nombre_del_estado')
->where('c_pais', $pais)
->orderBy('nombre_del_estado')
->pluck('nombre_del_estado', 'c_estado');
}
}