PHP Class DrawMyAttention\ResourceGenerator\Commands\ResourceMakeCommand

Inheritance: extends Illuminate\Console\Command
Exibir arquivo Open project: drawmyattention/laravel-make-resource

Protected Properties

Property Type Description
$description string The console command description.
$signature string The name and signature of the console command.

Public Methods

Method Description
__construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\Support\Composer $composer ) Create a new command instance.
addModelAttributes ( $name, $attributes, $stub )
buildFakerAttributes ( $attributes )
buildMigrationFilename ( $model )
buildTableColumns ( $attributes )
convertArrayToString ( $array ) : string Convert a PHP array into a string version.
convertModelToTableName ( $model )
handle ( ) : mixed Execute the console command.
parseAttributesFromInputString ( string $text ) : array Convert a pipe-separated list of attributes to an array.

Protected Methods

Method Description
buildMigration ( $name )
buildModel ( $name )

Private Methods

Method Description
addMigrationAttributes ( $text, $stub )
appendRoutes ( $modelName )
buildSchemaColumn ( string $fieldType, string $name, integer $length, array $traits = [] ) : string Create a Schema Builder column.
createController ( $modelName )
createMigration ( $name )
createModel ( string $name ) : boolean Create and store a new Model to the filesystem.
createModelFactory ( $name )
extractAttributePropertiesToApply ( $properties ) : array Get the column properties that should be applied to the column.
extractFieldLengthValue ( array $properties ) : integer Extract a numeric length value from all properties specified for the attribute.
getFieldTypeFromProperties ( array $properties ) : string Get the column field type based from the properties of the field being created.
modelName ( string $name ) : string Build a Model name from a word.
replaceClassName ( $name, $stub )
typeCanDefineSize ( string $type ) : boolean Can the data type have it's size controlled within the migration?

Method Details

__construct() public method

Create a new command instance.
public __construct ( Illuminate\Filesystem\Filesystem $files, Illuminate\Support\Composer $composer )
$files Illuminate\Filesystem\Filesystem
$composer Illuminate\Support\Composer

addModelAttributes() public method

public addModelAttributes ( $name, $attributes, $stub )

buildFakerAttributes() public method

public buildFakerAttributes ( $attributes )

buildMigration() protected method

protected buildMigration ( $name )

buildMigrationFilename() public method

public buildMigrationFilename ( $model )

buildModel() protected method

protected buildModel ( $name )

buildTableColumns() public method

public buildTableColumns ( $attributes )

convertArrayToString() public method

Convert a PHP array into a string version.
public convertArrayToString ( $array ) : string
$array
return string

convertModelToTableName() public method

public convertModelToTableName ( $model )

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed

parseAttributesFromInputString() public method

Convert a pipe-separated list of attributes to an array.
public parseAttributesFromInputString ( string $text ) : array
$text string The Pipe separated attributes
return array

Property Details

$description protected_oe property

The console command description.
protected string $description
return string

$signature protected_oe property

The name and signature of the console command.
protected string $signature
return string