class Illuminate / Console / GeneratorCommand
abstract

GeneratorCommand

Extends

Implements

Properties

protected

$files Filesystem

The filesystem instance.

Default: null
protected

$type string

The type of class being generated.

Default: null
protected

$reservedNames string[]

Reserved names that cannot be used for generation.

Default: array

Methods

public

__construct ( Filesystem $files ) : void

Create a new controller creator command instance.

Parameters

protected abstract

getStub ( ) : string

Get the stub file for the generator.

public

handle ( ) : bool|null

Execute the console command.

protected

qualifyClass ( $name ) : string

Parse the class name and format according to the root namespace.

Parameters

  • $name string
protected

qualifyModel ( string $model ) : string

Qualify the given model class base name.

Parameters

  • $model string
protected

possibleModels ( ) : array

Get a list of possible model names.

protected

possibleEvents ( ) : array

Get a list of possible event names.

protected

getDefaultNamespace ( $rootNamespace ) : string

Get the default namespace for the class.

Parameters

  • $rootNamespace string
protected

alreadyExists ( $rawName ) : bool

Determine if the class already exists.

Parameters

  • $rawName string
protected

getPath ( $name ) : string

Get the destination class path.

Parameters

  • $name string
protected

makeDirectory ( $path ) : string

Build the directory for the class if necessary.

Parameters

  • $path string
protected

buildClass ( $name ) : string

Build the class with the given name.

Parameters

  • $name string
protected

replaceNamespace ( $stub , $name ) : $this

Replace the namespace for the given stub.

Parameters

  • $stub string
  • $name string
protected

getNamespace ( $name ) : string

Get the full namespace for a given class, without the class name.

Parameters

  • $name string
protected

replaceClass ( $stub , $name ) : string

Replace the class name for the given stub.

Parameters

  • $stub string
  • $name string
protected

sortImports ( $stub ) : string

Alphabetically sorts the imports for the given stub.

Parameters

  • $stub string
protected

getNameInput ( ) : string

Get the desired class name from the input.

protected

rootNamespace ( ) : string

Get the root namespace for the class.

protected

userProviderModel ( ) : string|null

Get the model for the default guard's user provider.

protected

isReservedName ( $name ) : bool

Checks whether the given name is reserved.

Parameters

  • $name string
protected

viewPath ( $path ) : string

Get the first view directory path from the application configuration.

Parameters

  • $path string
protected

getArguments ( ) : array

Get the console command arguments.

protected

promptForMissingArgumentsUsing ( ) : array

Prompt for missing input arguments using the returned questions.