HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/posscale/public_html/printmanager/vendor/filament/actions/src/Concerns/CanBeMounted.php
<?php

namespace Filament\Actions\Concerns;

use Closure;
use Filament\Forms\ComponentContainer;
use Filament\Forms\Form;

trait CanBeMounted
{
    protected ?Closure $mountUsing = null;

    /**
     * @param  array<string, mixed>  $parameters
     */
    public function mount(array $parameters): mixed
    {
        return $this->evaluate($this->getMountUsing(), $parameters);
    }

    public function mountUsing(?Closure $callback): static
    {
        $this->mountUsing = $callback;

        return $this;
    }

    /**
     * @param  array<string, mixed> | Closure | null  $data
     */
    public function fillForm(array | Closure | null $data): static
    {
        $this->mountUsing(function (?Form $form) use ($data) {
            $form?->fill($this->evaluate($data));
        });

        return $this;
    }

    public function getMountUsing(): Closure
    {
        return $this->mountUsing ?? static function (?ComponentContainer $form = null): void {
            if (! $form) {
                return;
            }

            $form->fill();
        };
    }
}