Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions en/digging-deeper/artisan-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,19 @@ func (receiver *SendEmails) Handle(ctx console.Context) error {
}
```

There are few helpers to write to console with respective color:

```go
ctx.Green("This is a green message")
ctx.Greenln("This is a green line message")
ctx.Red("This is a red message")
ctx.Redln("This is a red line message")
ctx.Yellow("This is a yellow message")
ctx.Yellowln("This is a yellow line message")
ctx.Black("This is a black message")
ctx.Blackln("This is a black line message")
```

You can use the `NewLine` method to write a new line to the console:

```go
Expand Down Expand Up @@ -424,6 +437,15 @@ err := ctx.Spinner("Loading...", console.SpinnerOption{
})
```

### Divider

To show terminal-width divider you may use `Divider` method.

```go
ctx.Divider() // ----------
ctx.Divider("=>") // =>=>=>=>=>
```

## Category

You can set a set of commands to the same category, convenient in `go run . artisan list`:
Expand Down