File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/prompts/src
Upload
[..]
Clear.php (602 B)
Edit
Rename
Del
Concerns/
Rename
Del
ConfirmPrompt.php (1.36 KB)
Edit
Rename
Del
Exceptions/
Rename
Del
FormStep.php (1.33 KB)
Edit
Rename
Del
MultiSearchPrompt.php (6.63 KB)
Edit
Rename
Del
NotifyPrompt.php (3.15 KB)
Edit
Rename
Del
Output/
Rename
Del
Progress.php (4.85 KB)
Edit
Rename
Del
SearchPrompt.php (4.26 KB)
Edit
Rename
Del
Spinner.php (3.27 KB)
Edit
Rename
Del
Stream.php (3.14 KB)
Edit
Rename
Del
SuggestPrompt.php (4.29 KB)
Edit
Rename
Del
Support/
Rename
Del
Table.php (1.58 KB)
Edit
Rename
Del
TextPrompt.php (885 B)
Edit
Rename
Del
Themes/
Rename
Del
Title.php (573 B)
Edit
Rename
Del
helpers.php (12.39 KB)
Edit
Rename
Del
Edit: 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; } }
Simpan