PHP 8.3.31
Preview: ConfirmPrompt.php Size: 1.36 KB
/home/getspomw/royalsquad.us/vendor/laravel/prompts/src/ConfirmPrompt.php

<?php

namespace Laravel\Prompts;

use Closure;

class ConfirmPrompt extends Prompt
{
    /**
     * Whether the prompt has been confirmed.
     */
    public bool $confirmed;

    /**
     * Create a new ConfirmPrompt instance.
     */
    public function __construct(
        public string $label,
        public bool $default = true,
        public string $yes = 'Yes',
        public string $no = 'No',
        public bool|string $required = false,
        public mixed $validate = null,
        public string $hint = '',
        public ?Closure $transform = null,
    ) {
        $this->confirmed = $default;

        $this->on('key', fn ($key) => match ($key) {
            'y' => $this->confirmed = true,
            'n' => $this->confirmed = false,
            Key::TAB, Key::UP, Key::UP_ARROW, Key::DOWN, Key::DOWN_ARROW, Key::LEFT, Key::LEFT_ARROW, Key::RIGHT, Key::RIGHT_ARROW, Key::CTRL_P, Key::CTRL_F, Key::CTRL_N, Key::CTRL_B, 'h', 'j', 'k', 'l' => $this->confirmed = ! $this->confirmed,
            Key::ENTER => $this->submit(),
            default => null,
        });
    }

    /**
     * Get the value of the prompt.
     */
    public function value(): bool
    {
        return $this->confirmed;
    }

    /**
     * Get the label of the selected option.
     */
    public function label(): string
    {
        return $this->confirmed ? $this->yes : $this->no;
    }
}

Directory Contents

Dirs: 5 × Files: 22

Name Size Perms Modified Actions
Concerns DIR
- drwxrwxrwx 2025-09-17 06:52:54
Edit Download
- drwxrwxrwx 2025-09-17 06:52:54
Edit Download
Output DIR
- drwxrwxrwx 2026-04-21 16:06:43
Edit Download
Support DIR
- drwxrwxrwx 2025-09-17 06:52:54
Edit Download
Themes DIR
- drwxrwxrwx 2025-09-17 06:52:54
Edit Download
602 B lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
1.36 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
13.51 KB lrw-r--r-- 2026-04-26 08:25:40
Edit Download
9.58 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
1.32 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
7.89 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
1.77 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
6.15 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
4.13 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
702 B lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
1.00 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
568 B lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
4.59 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
10.87 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
4.03 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
3.25 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
3.24 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
3.97 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
1.58 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
2.43 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
6.94 KB lrw-rw-rw- 2025-09-17 06:52:54
Edit Download
885 B lrw-rw-rw- 2025-09-17 06:52:54
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).