Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/./../app/.././../../finland.picotech.app/public_html/storage/../vendor/./phpoption/../laravel/../nikic/../telnyx/../brick/../unicodeveloper/../firebase/../nunomaduro/../phpoption/../ralouphie/../phar-io/../laravel/./prompts/src
الملفات الموجودة في هذا الـ Path:
.
..
Concerns
ConfirmPrompt.php
Exceptions
Key.php
MultiSearchPrompt.php
MultiSelectPrompt.php
Note.php
Output
PasswordPrompt.php
Progress.php
Prompt.php
SearchPrompt.php
SelectPrompt.php
Spinner.php
SuggestPrompt.php
Table.php
Terminal.php
TextPrompt.php
Themes
helpers.php

مشاهدة ملف: PasswordPrompt.php

<?php

namespace Laravel\Prompts;

use Closure;

class PasswordPrompt extends Prompt
{
    use Concerns\TypedValue;

    /**
     * Create a new PasswordPrompt instance.
     */
    public function __construct(
        public string $label,
        public string $placeholder = '',
        public bool|string $required = false,
        public ?Closure $validate = null,
        public string $hint = ''
    ) {
        $this->trackTypedValue();
    }

    /**
     * Get a masked version of the entered value.
     */
    public function masked(): string
    {
        return str_repeat('•', mb_strlen($this->value()));
    }

    /**
     * Get the masked value with a virtual cursor.
     */
    public function maskedWithCursor(int $maxWidth): string
    {
        if ($this->value() === '') {
            return $this->dim($this->addCursor($this->placeholder, 0, $maxWidth));
        }

        return $this->addCursor($this->masked(), $this->cursorPosition, $maxWidth);
    }
}