PHP Class Nwidart\Modules\Migrations\Migrator

Show file Open project: nwidart/laravel-modules Class Usage Examples

Protected Properties

Property Type Description
$database string The database connection to be used
$laravel Illuminate\Foundation\Application. Laravel Application instance.
$module Nwidart\Modules\Module Pingpong Module instance.

Public Methods

Method Description
__construct ( Module $module ) Create new instance.
down ( string $migration ) Run down schema from the given migration name.
find ( string $migration ) : object Find migration data from database by given migration name.
getLast ( array $migrations ) : Collection Get the last migration batch.
getLastBatchNumber ( array $migrations ) : integer Get the last migration batch number.
getMigrations ( boolean $reverse = false ) : array Get migration files.
getModule ( ) : Module
getNextBatchNumber ( ) : integer Get the next migration batch number.
getPath ( ) : string Get migration path.
getRan ( ) : Collection Get the ran migrations.
log ( string $migration ) : mixed Save new migration to database.
requireFiles ( array $files ) Require in all the migration files in a given path.
reset ( ) : array Reset migration.
resolve ( string $file ) : object Resolve a migration instance from a file.
rollback ( ) : array Rollback migration.
setDatabase ( $database ) Set the database connection to be used
table ( ) : string Get table instance.
up ( string $migration ) Run up schema from the given migration name.

Method Details

__construct() public method

Create new instance.
public __construct ( Module $module )
$module Nwidart\Modules\Module

down() public method

Run down schema from the given migration name.
public down ( string $migration )
$migration string

find() public method

Find migration data from database by given migration name.
public find ( string $migration ) : object
$migration string
return object

getLast() public method

Get the last migration batch.
public getLast ( array $migrations ) : Collection
$migrations array
return Illuminate\Support\Collection

getLastBatchNumber() public method

Get the last migration batch number.
public getLastBatchNumber ( array $migrations ) : integer
$migrations array
return integer

getMigrations() public method

Get migration files.
public getMigrations ( boolean $reverse = false ) : array
$reverse boolean
return array

getModule() public method

public getModule ( ) : Module
return Nwidart\Modules\Module

getNextBatchNumber() public method

Get the next migration batch number.
public getNextBatchNumber ( ) : integer
return integer

getPath() public method

Get migration path.
public getPath ( ) : string
return string

getRan() public method

Get the ran migrations.
public getRan ( ) : Collection
return Illuminate\Support\Collection

log() public method

Save new migration to database.
public log ( string $migration ) : mixed
$migration string
return mixed

requireFiles() public method

Require in all the migration files in a given path.
public requireFiles ( array $files )
$files array

reset() public method

Reset migration.
public reset ( ) : array
return array

resolve() public method

Resolve a migration instance from a file.
public resolve ( string $file ) : object
$file string
return object

rollback() public method

Rollback migration.
public rollback ( ) : array
return array

setDatabase() public method

Set the database connection to be used
public setDatabase ( $database )
$database

table() public method

Get table instance.
public table ( ) : string
return string

up() public method

Run up schema from the given migration name.
public up ( string $migration )
$migration string

Property Details

$database protected property

The database connection to be used
protected string $database
return string

$laravel protected property

Laravel Application instance.
protected Application.,Illuminate\Foundation $laravel
return Illuminate\Foundation\Application.

$module protected property

Pingpong Module instance.
protected Module,Nwidart\Modules $module
return Nwidart\Modules\Module