class Illuminate / Database / Console / ShowModelCommand
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

ShowModelCommand

Extends

Properties

protected

$name string

The console command name.

Default: 'model:show {model}'
protected

$description string

The console command description.

Default: 'Show information about an Eloquent model'
protected

$signature string

The console command signature.

Default: 'model:show {model : The model to show} {--database= : The database connection to use} {--json : Output the model as JSON}'
protected

$relationMethods array

The methods that can be called in a model to indicate a relation.

Default: array

Methods

public

handle ( ) : int

Execute the console command.

protected

getPolicy ( $model ) : string

Get the first policy associated with this model.

Parameters

protected

getAttributes ( $model ) : Illuminate\...\Collection

Get the column attributes for the given model.

Parameters

protected

getVirtualAttributes ( $model , $columns ) : Illuminate\...\Collection

Get the virtual (non-column) attributes for the given model.

Parameters

  • $model Model
  • $columns Doctrine\...\Column[]
protected

getRelations ( $model ) : Illuminate\...\Collection

Get the relations from the given model.

Parameters

protected

getObservers ( $model ) : Illuminate\...\Collection

Get the Observers watching this model.

Parameters

protected

display ( $class , $database , $table , $policy , $attributes , $relations , $observers ) : void

Render the model information.

Parameters

  • $class string
  • $database string
  • $table string
  • $policy string
  • $attributes Illuminate\...\Collection
  • $relations Illuminate\...\Collection
  • $observers Illuminate\...\Collection
protected

displayJson ( $class , $database , $table , $policy , $attributes , $relations , $observers ) : void

Render the model information as JSON.

Parameters

  • $class string
  • $database string
  • $table string
  • $policy string
  • $attributes Illuminate\...\Collection
  • $relations Illuminate\...\Collection
  • $observers Illuminate\...\Collection
protected

displayCli ( $class , $database , $table , $policy , $attributes , $relations , $observers ) : void

Render the model information for the CLI.

Parameters

  • $class string
  • $database string
  • $table string
  • $policy string
  • $attributes Illuminate\...\Collection
  • $relations Illuminate\...\Collection
  • $observers Illuminate\...\Collection
protected

getCastType ( $column , $model ) : string|null

Get the cast type for the given column.

Parameters

protected

getCastsWithDates ( $model ) : Illuminate\...\Collection

Get the model casts, including any date casts.

Parameters

protected

getColumnType ( $column ) : string

Get the type of the given column.

Parameters

  • $column Doctrine\...\Column
protected

getColumnDefault ( $column , $model ) : mixed|null

Get the default value for the given column.

Parameters

  • $column Doctrine\...\Column
  • $model Model
protected

attributeIsHidden ( $attribute , $model ) : bool

Determine if the given attribute is hidden.

Parameters

  • $attribute string
  • $model Model
protected

columnIsUnique ( $column , $indexes ) : bool

Determine if the given attribute is unique.

Parameters

  • $column string
  • $indexes Doctrine\...\Index[]
protected

qualifyModel ( string $model ) : string

Qualify the given model class base name.

Parameters

  • $model string

See

  • \Illuminate\Console\GeneratorCommand