HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/posscale/www/printmanager/vendor/filament/tables/src/Columns/Concerns/CanBeToggled.php
<?php

namespace Filament\Tables\Columns\Concerns;

use Closure;

trait CanBeToggled
{
    protected bool | Closure $isToggleable = false;

    protected bool | Closure $isToggledHiddenByDefault = false;

    public function toggleable(bool | Closure $condition = true, bool | Closure $isToggledHiddenByDefault = false): static
    {
        $this->isToggleable = $condition;
        $this->toggledHiddenByDefault($isToggledHiddenByDefault);

        return $this;
    }

    public function toggledHiddenByDefault(bool | Closure $condition = true): static
    {
        $this->isToggledHiddenByDefault = $condition;

        return $this;
    }

    public function isToggledHiddenByDefault(): bool
    {
        return (bool) $this->evaluate($this->isToggledHiddenByDefault);
    }

    public function isToggleable(): bool
    {
        if ($this->isHidden()) {
            return false;
        }

        return (bool) $this->evaluate($this->isToggleable);
    }

    public function isToggledHidden(): bool
    {
        if (! $this->isToggleable()) {
            return false;
        }

        return $this->getTable()->getLivewire()->isTableColumnToggledHidden($this->getName());
    }
}