class Illuminate / Foundation / Console / DocsCommand

DocsCommand

Extends

Properties

protected

$signature string

The name and signature of the console command.

Default: 'docs {page? : The documentation page to open} {section? : The section of the page to open}'
protected

$description string

The console command description.

Default: 'Access the Laravel documentation'
protected

$help string

The console command help text.

Default: 'If you would like to perform a content search against the documention, you may call: <fg=green>php artisan docs -- </><fg=green;options=bold;>search query here</>'
protected

$http Factory

The HTTP client instance.

Default: null
protected

$cache Repository

The cache repository implementation.

Default: null
protected

$urlOpener callable|null

The custom URL opener.

Default: null
protected

$version string|null

The custom documentation version to open.

Default: null
protected

$systemOsFamily string

The operating system family.

Default: PHP_OS_FAMILY

Methods

protected

configure ( ) : void

Configure the current command.

public

handle ( Factory $http , Repository $cache ) : int

Execute the console command.

Parameters

protected

openUrl ( ) : void

Open the documentation URL.

protected

url ( ) : string

The URL to the documentation page.

protected

page ( ) : string

The page the user is opening.

protected

resolvePage ( ) : string|null

Determine the page to open.

protected

didNotRequestPage ( ) : bool

Determine if the user requested a specific page when calling the command.

protected

askForPage ( ) : string|null

Ask the user which page they would like to open.

protected

askForPageViaCustomStrategy ( ) : string|null

Ask the user which page they would like to open via a custom strategy.

protected

askForPageViaAutocomplete ( ) : string|null

Ask the user which page they would like to open using autocomplete.

protected

guessPage ( $search ) : string|null

Guess the page the user is attempting to open.

protected

section ( $page ) : string|null

The section the user specifically asked to open.

Parameters

  • $page string
protected

didNotRequestSection ( ) : bool

Determine if the user requested a specific section when calling the command.

protected

guessSection ( $page ) : string|null

Guess the section the user is attempting to open.

Parameters

  • $page string
protected

open ( $url ) : void

Open the URL in the user's browser.

Parameters

  • $url string
protected

openViaCustomStrategy ( $url ) : void

Open the URL via a custom strategy.

Parameters

  • $url string
protected

openViaBuiltInStrategy ( $url ) : void

Open the URL via the built in strategy.

Parameters

  • $url string
public

sectionsFor ( $page ) : Illuminate\...\Collection

The available sections for the page.

Parameters

  • $page string
public

pages ( ) : Illuminate\...\Collection

The pages available to open.

public

docs ( ) : Illuminate\...\Collection

Get the documentation index as a collection.

protected

refreshDocs ( ) : void

Refresh the cached copy of the documentation index.

protected

fetchDocs ( ) : Response

Fetch the documentation index from the Laravel website.

protected

version ( ) : string

Determine the version of the docs to open.

protected

searchQuery ( ) : string

The search query the user provided.

protected

isSearching ( ) : bool

Determine if the command is intended to perform a search.

public

setVersion ( $version ) : $this

Set the documentation version.

Parameters

  • $version string
public

setUrlOpener ( $opener ) : $this

Set a custom URL opener.

Parameters

  • $opener callable|null
public

setSystemOsFamily ( $family ) : $this

Set the system operating system family.

Parameters

  • $family string