PHP Class Laralib\L5scaffold\Migrations\SyntaxBuilder

Author: Jeffrey Way ([email protected])
Show file Open project: laralib/l5scaffold

Protected Properties

Property Type Description
$illuminate boolean

Public Methods

Method Description
create ( array $schema, array $meta, string $type = "migration", boolean $illuminate = false ) : string Create the PHP syntax for the given schema.
setIllumination ( $value ) Enable/Disable use of Illuminate/Html form facades

Private Methods

Method Description
addColumn ( string $field, string $type = "migration", $meta = "" ) : string Construct the syntax to add a column.
buildField ( $field, $type, $variable, boolean $value = true ) : string Build form field with validation using Illuminate/Html Form facade or pure HTML
constructSchema ( array $schema, string $direction = 'Add' ) : array Construct the schema fields.
createSchemaForControllerMethod ( $schema, $meta ) : string Construct the controller fields
createSchemaForDownMethod ( array $schema, array $meta ) : string Construct the syntax for a down field.
createSchemaForUpMethod ( string $schema, array $meta ) : string Create the schema for the "up" method.
createSchemaForViewMethod ( $schema, $meta, string $type = 'index-header' ) : string Construct the view fields
dropColumn ( string $field ) : string Construct the syntax to drop a column.
getChangeSchemaWrapper ( ) : string Get the wrapper template for an "add" action.
getCreateSchemaWrapper ( ) : string Get the wrapper template for a "create" action.
htmlField ( $column, $variable, $field, $type )
insert ( string $template ) Store the given template, to be inserted somewhere.
into ( string $wrapper, string $placeholder = 'schema_up' ) : mixed Get the stored template, and insert into the given wrapper.

Method Details

create() public method

Create the PHP syntax for the given schema.
public create ( array $schema, array $meta, string $type = "migration", boolean $illuminate = false ) : string
$schema array
$meta array
$type string
$illuminate boolean
return string

setIllumination() public method

Enable/Disable use of Illuminate/Html form facades
public setIllumination ( $value )
$value

Property Details

$illuminate protected property

protected bool $illuminate
return boolean