Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/./../app/.././../../finland.picotech.app/public_html/storage/../vendor/./nikic/../dompdf/../alexandr-mironov/../monolog/../unicodeveloper/../dragonmantank/../nunomaduro/../mockery/../phar-io/../mockery/../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

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

<?php

namespace Laravel\Prompts;

use Closure;

class TextPrompt extends Prompt
{
    use Concerns\TypedValue;

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

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

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