HEX
Server: LiteSpeed
System: Linux s3.sitechai.com 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: workzeni (2217)
PHP: 8.1.32
Disabled: mail, show_source, system, shell_exec, passthru, exec, eval, shell
Upload Files
File: /home/workzeni/agency-erp-05.workzenix.com/vendor/livewire/livewire/src/WireDirective.php
<?php

namespace Livewire;

use Stringable;
use Illuminate\View\ComponentAttributeBag;
use Illuminate\Contracts\Support\Htmlable;

class WireDirective implements Htmlable, Stringable
{
    public function __construct(
        public $name,
        public $directive,
        public $value,
    ) {}

    public function name()
    {
        return $this->name;
    }

    public function directive()
    {
        return $this->directive;
    }

    public function value()
    {
        return $this->value;
    }

    public function modifiers()
    {
        return str($this->directive)
            ->replace("wire:{$this->name}", '')
            ->explode('.')
            ->filter()->values();
    }

    public function hasModifier($modifier)
    {
        return $this->modifiers()->contains($modifier);
    }

    public function toHtml()
    {
        return (new ComponentAttributeBag([$this->directive => $this->value]))->toHtml();
    }

    public function toString()
    {
        return (string) $this;
    }

    public function __toString()
    {
        return (string) $this->value;
    }
}