Download the PHP package sirval/laravel-smart-migrations without Composer

On this page you can find all versions of the php package sirval/laravel-smart-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-smart-migrations

Laravel Smart Migrations

Intelligently manage Laravel migrations with safe rollback, analysis, validation, and comprehensive tools for table and model-based operations.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A comprehensive Laravel package for intelligent migration management. Roll back migrations by table name or model, with explicit, safe options to prevent accidental data loss. Future versions will include analysis, validation, and optimization tools.

⭐ Give us a Star

If you find this package helpful, please consider giving us a star on GitHub! It helps us continue maintaining and improving this package. Your support means a lot to us! ☕

⭐ Star us on GitHub

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

This is the contents of the published config file:

Optionally, you can publish the views using

Usage

Available Commands

1. Rollback by Table Name

Roll back all migrations for a specific table:

2. Rollback by Model Name

Roll back all migrations associated with a specific model:

3. Rollback by Batch Number

Roll back all migrations from a specific batch:

4. List Migrations for Table

View all migrations affecting a specific table:

5. List Migrations for Model

View all migrations associated with a specific model:

Command Options

Option Short Description Default
--latest -L Only rollback the latest migration false
--oldest -O Only rollback the oldest migration false
--all -A Rollback all migrations (ignore batch restrictions) false
--batch=N -B Only rollback migrations from batch N null
--force -F Skip confirmation prompts false
--interactive -I Show options and let user choose false
--preview Preview changes without executing rollback false
--check-fk Check and display foreign key constraints false

Advanced Features

Preview Mode (--preview)

Preview what migrations will be rolled back without making any database changes. This is useful for testing and validation before executing the actual rollback.

When you run with --preview, the command will:

Foreign Key Detection (--check-fk)

Automatically detect and display all foreign key constraints before rolling back migrations. This helps prevent breaking references between tables.

The foreign key check displays:

Supported Databases:

Combined Usage

For maximum safety, combine preview mode with foreign key detection:

This allows you to:

  1. See all migrations that will be rolled back
  2. Identify any foreign key constraints
  3. Verify safety without making changes
  4. Execute with confidence when ready

Configuration

The package respects these configuration options from config/smart-migrations.php:

Programmatic Usage

Use the SmartMigrations facade for programmatic access:

Available Options for Rollback Methods

When calling rollback methods programmatically, pass options as an array:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-smart-migrations with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sirval/laravel-smart-migrations contains the following files

Loading the files please wait ...