src/commands/UserAbstractController.php
protected function readValue(User $user, string $attribute) : void
    {
        $user->$attribute = $this->prompt(mb_convert_case($attribute, MB_CASE_TITLE, 'utf-8') . ':', [
            'validator' => function ($input, &$error) use ($user, $attribute) {
                $user->$attribute = $input;
                if ($user->validate([$attribute])) {
                    return true;
                } else {
                    $error = implode(',', $user->getErrors($attribute));
                    return false;
                }
            },
        ]);
    }
protected function readValue(User $user, string $attribute) : void
    {
        $user->$attribute = $this->prompt(mb_convert_case($attribute, MB_CASE_TITLE, 'utf-8') . ':', [
            'validator' => function ($input, &$error) use ($user, $attribute) {
                $user->$attribute = $input;
                if ($user->validate([$attribute])) {
                    return true;
                } else {
                    $error = implode(',', $user->getErrors($attribute));
                    return false;
                }
            },
        ]);
    }
protected function readValue ( User $ user , string $ attribute ) : void { $ user -> $ attribute = $ this -> prompt ( mb_convert_case ( $ attribute , MB_CASE_TITLE , 'utf-8' ) . ':' , [ 'validator' => function ( $ input , & $ error ) use ( $ user , $ attribute ) { $ user -> $ attribute = $ input ; if ( $ user -> validate ( [ $ attribute ] ) ) { return true ; } else { $ error = implode ( ',' , $ user -> getErrors ( $ attribute ) ) ; return false ; } } , ] ) ; }
Get the value of the console.
@param User   $user
@param string $attribute
@return void
Get the value of the console .