*/ protected $fillable = [ 'nombre', 'rfc', 'direccion', 'telefono', 'email', 'activo' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'activo' => 'boolean', ]; /** * Scope para obtener solo empresas activas */ public function scopeActivas($query) { return $query->where('activo', true); } }