master

laravel/framework

Last updated at: 29/12/2023 09:20

Confirm.php

TLDR

This file contains the Confirm class, which is a component used in the Illuminate\Console\View\Components namespace. The class has a single method named render which is responsible for rendering the component using the given arguments.

Classes

Confirm

The Confirm class extends the Component class and is used as a component in the Illuminate\Console\View\Components namespace. It has a method named render which takes two arguments: $question and $default. The method returns a boolean value and is responsible for rendering the component using the given arguments.

<?php

namespace Illuminate\Console\View\Components;

class Confirm extends Component
{
    /**
     * Renders the component using the given arguments.
     *
     * @param  string  $question
     * @param  bool  $default
     * @return bool
     */
    public function render($question, $default = false)
    {
        return $this->usingQuestionHelper(
            fn () => $this->output->confirm($question, $default),
        );
    }
}