class MigrationCreator

Properties

protected Filesystem $files The filesystem instance.
protected Paths $paths

Methods

__construct(Filesystem $files, Paths $paths)

Create a new migrator instance.

string
create(string $name, string $extension = null, string $table = null, bool $create = false)

Create a new migration for the given extension.

string
getStub(string $table, bool $create)

Get the migration stub file.

string
populateStub(string $stub, string $table)

Populate the place-holders in the migration stub.

string
getMigrationPath(string $extension)

Get the full path name to the migration directory.

string
getPath(string $name, string $path)

Get the full path name to the migration.

string
getDatePrefix()

Get the date prefix for the migration.

string
getStubPath()

Get the path to the stubs.

Details

__construct(Filesystem $files, Paths $paths)

Create a new migrator instance.

Parameters

Filesystem $files
Paths $paths

string create(string $name, string $extension = null, string $table = null, bool $create = false)

Create a new migration for the given extension.

Parameters

string $name
string $extension
string $table
bool $create

Return Value

string

protected string getStub(string $table, bool $create)

Get the migration stub file.

Parameters

string $table
bool $create

Return Value

string

protected string populateStub(string $stub, string $table)

Populate the place-holders in the migration stub.

Parameters

string $stub
string $table

Return Value

string

protected string getMigrationPath(string $extension)

Get the full path name to the migration directory.

Parameters

string $extension

Return Value

string

protected string getPath(string $name, string $path)

Get the full path name to the migration.

Parameters

string $name
string $path

Return Value

string

protected string getDatePrefix()

Get the date prefix for the migration.

Return Value

string

protected string getStubPath()

Get the path to the stubs.

Return Value

string