MigrationCreator
in package
Table of Contents
- $files : Filesystem
- The filesystem instance.
- $postCreate : array<string|int, mixed>
- The registered post create hooks.
- __construct() : void
- Create a new migration creator instance.
- afterCreate() : void
- Register a post migration create hook.
- create() : string
- Create a new migration at the given path.
- getFilesystem() : Filesystem
- Get the filesystem instance.
- stubPath() : string
- Get the path to the stubs.
- ensureMigrationDoesntAlreadyExist() : void
- Ensure that a migration with the given name doesn't already exist.
- firePostCreateHooks() : void
- Fire the registered post create hooks.
- getClassName() : string
- Get the class name of a migration name.
- getDatePrefix() : string
- Get the date prefix for the migration.
- getPath() : string
- Get the full path to the migration.
- getStub() : string
- Get the migration stub file.
- populateStub() : string
- Populate the place-holders in the migration stub.
Properties
$files
The filesystem instance.
protected
Filesystem
$files
$postCreate
The registered post create hooks.
protected
array<string|int, mixed>
$postCreate
= []
Methods
__construct()
Create a new migration creator instance.
public
__construct(Filesystem $files) : void
Parameters
- $files : Filesystem
Return values
void —afterCreate()
Register a post migration create hook.
public
afterCreate(Closure $callback) : void
Parameters
- $callback : Closure
Return values
void —create()
Create a new migration at the given path.
public
create(string $name, string $path[, string $table = null ][, bool $create = false ]) : string
Parameters
- $name : string
- $path : string
- $table : string = null
- $create : bool = false
Tags
Return values
string —getFilesystem()
Get the filesystem instance.
public
getFilesystem() : Filesystem
Return values
Filesystem —stubPath()
Get the path to the stubs.
public
stubPath() : string
Return values
string —ensureMigrationDoesntAlreadyExist()
Ensure that a migration with the given name doesn't already exist.
protected
ensureMigrationDoesntAlreadyExist(string $name) : void
Parameters
- $name : string
Tags
Return values
void —firePostCreateHooks()
Fire the registered post create hooks.
protected
firePostCreateHooks() : void
Return values
void —getClassName()
Get the class name of a migration name.
protected
getClassName(string $name) : string
Parameters
- $name : string
Return values
string —getDatePrefix()
Get the date prefix for the migration.
protected
getDatePrefix() : string
Return values
string —getPath()
Get the full path to the migration.
protected
getPath(string $name, string $path) : string
Parameters
- $name : string
- $path : string
Return values
string —getStub()
Get the migration stub file.
protected
getStub(string $table, bool $create) : string
Parameters
- $table : string
- $create : bool
Return values
string —populateStub()
Populate the place-holders in the migration stub.
protected
populateStub(string $name, string $stub, string $table) : string
Parameters
- $name : string
- $stub : string
- $table : string