trait CommandUtilTrait (View source)

Console commands utilities.

Methods

void
line(string $string, string|null $style = null, int|string|null $verbosity = null)

Write a string as standard output.

bool
runInProduction(string $warning = 'Application In Production!')

Warn user running command in production.

void
printLabels(string $title, array|string $body = null)

Print formatted labels.

void
updateSetting(string $name, string $key, string $value)

Write | replace setting in .env file.

Details

abstract void line(string $string, string|null $style = null, int|string|null $verbosity = null)

Write a string as standard output.

Parameters

string $string
string|null $style
int|string|null $verbosity

Return Value

void

See also

InteractsWithIO::line

protected bool runInProduction(string $warning = 'Application In Production!')

Warn user running command in production.

Parameters

string $warning

Return Value

bool

protected void printLabels(string $title, array|string $body = null)

Print formatted labels.

Parameters

string $title
array|string $body

Return Value

void

protected void updateSetting(string $name, string $key, string $value)

Write | replace setting in .env file.

Parameters

string $name

ENV_VALUE, like; APP_NAME

string $key

Compose setting name, like app.name

string $value

Setting value

Return Value

void