Methods |
public
|
__construct(
MigrationRepositoryInterface $repository,
ConnectionResolverInterface $resolver,
Filesystem $files,
Dispatcher|null $dispatcher = null,
): void
Create a new migrator instance.
Create a new migrator instance.
|
#
|
public
|
run(array|string $paths = [], array $options = []): array
Run the pending migrations at a given path.
Run the pending migrations at a given path.
|
#
|
public
|
runPending(array $migrations, array $options = []): void
Run an array of migrations.
Run an array of migrations.
|
#
|
public
|
rollback(array|string $paths = [], array $options = []): array
Rollback the last migration operation.
Rollback the last migration operation.
|
#
|
public
|
reset(array|string $paths = [], bool $pretend = false): array
Rolls all of the currently applied migrations back.
Rolls all of the currently applied migrations back.
|
#
|
public
|
resolve(string $file): object
Resolve a migration instance from a file.
Resolve a migration instance from a file.
|
#
|
public
|
getMigrationFiles(string|array $paths): array
Get all of the migration files in a given path.
Get all of the migration files in a given path.
|
#
|
public
|
requireFiles(array $files): void
Require in all the migration files in a given path.
Require in all the migration files in a given path.
|
#
|
public
|
getMigrationName(string $path): string
Get the name of the migration.
Get the name of the migration.
|
#
|
public
|
path(string $path): void
Register a custom migration path.
Register a custom migration path.
|
#
|
public
|
paths(): array
Get all of the custom migration paths.
Get all of the custom migration paths.
|
#
|
public
|
getConnection(): string
Get the default connection name.
Get the default connection name.
|
#
|
public
|
usingConnection(string $name, callable $callback): mixed
Execute the given callback using the given connection as the default connection.
Execute the given callback using the given connection as the default connection.
|
#
|
public
|
setConnection(string $name): void
Set the default connection name.
Set the default connection name.
|
#
|
public
|
resolveConnection(string $connection): Connection
Resolve the database connection instance.
Resolve the database connection instance.
|
#
|
public
|
getRepository(): MigrationRepositoryInterface
Get the migration repository instance.
Get the migration repository instance.
|
#
|
public
|
repositoryExists(): bool
Determine if the migration repository exists.
Determine if the migration repository exists.
|
#
|
public
|
hasRunAnyMigrations(): bool
Determine if any migrations have been run.
Determine if any migrations have been run.
|
#
|
public
|
deleteRepository(): void
Delete the migration repository data store.
Delete the migration repository data store.
|
#
|
public
|
getFilesystem(): Filesystem
Get the file system instance.
Get the file system instance.
|
#
|
public
|
setOutput(OutputInterface $output): $this
Set the output implementation that should be used by the console.
Set the output implementation that should be used by the console.
|
#
|
public
|
fireMigrationEvent(MigrationEvent $event): void
Fire the given event for the migration.
Fire the given event for the migration.
|
#
|