class Illuminate / Database / Migrations / MigrationCreator

MigrationCreator

Properties

protected

$files Filesystem

The filesystem instance.

Default: null
protected

$customStubPath string

The custom app stubs directory.

Default: null
protected

$postCreate array

The registered post create hooks.

Default: []

Methods

public

__construct ( Filesystem $files , $customStubPath ) : void

Create a new migration creator instance.

Parameters

public

create ( $name , $path , $table , $create ) : string

Create a new migration at the given path.

Parameters

  • $name string
  • $path string
  • $table string|null
  • $create bool
protected

ensureMigrationDoesntAlreadyExist ( $name , $migrationPath ) : void

Ensure that a migration with the given name doesn't already exist.

Parameters

  • $name string
  • $migrationPath string
protected

getStub ( $table , $create ) : string

Get the migration stub file.

Parameters

  • $table string|null
  • $create bool
protected

populateStub ( $stub , $table ) : string

Populate the place-holders in the migration stub.

Parameters

  • $stub string
  • $table string|null
protected

getClassName ( $name ) : string

Get the class name of a migration name.

Parameters

  • $name string
protected

getPath ( $name , $path ) : string

Get the full path to the migration.

Parameters

  • $name string
  • $path string
protected

firePostCreateHooks ( $table , $path ) : void

Fire the registered post create hooks.

Parameters

  • $table string|null
  • $path string
public

afterCreate ( Closure $callback ) : void

Register a post migration create hook.

Parameters

protected

getDatePrefix ( ) : string

Get the date prefix for the migration.

public

stubPath ( ) : string

Get the path to the stubs.

public

getFilesystem ( ) : Filesystem

Get the filesystem instance.