Download the PHP package abdullahkaram-dev/laravel-migration-sorter without Composer

On this page you can find all versions of the php package abdullahkaram-dev/laravel-migration-sorter. 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-migration-sorter

πŸ”„ Laravel Migration Sorter

GitHub stars Packagist Downloads Laravel Version Latest Version on Packagist

An interactive Laravel command for sorting database migration files with drag-and-drop functionality and automatic timestamp regeneration.

Migration Sorter Interface

πŸ€” Why Use This Command?

❌ Common Migration Problems

βœ… Solutions This Package Provides

🌟 Real-World Scenarios

  1. After merging branches - Sort conflicting migration timestamps from multiple feature branches πŸŒΏπŸ”€
  2. Before production deployment - Ensure migrations will execute in the correct logical order πŸš€βœ…
  3. Database refactoring - Reorganize migrations to match your current database structure needs πŸ—οΈπŸ”§
  4. Team onboarding - Help new developers understand the database evolution timeline πŸ‘¨β€πŸ’»πŸ“ˆ
  5. Migration cleanup - Organize legacy migrations for better maintainability 🧹✨

Features

Interactive Terminal Interface

Multiple Sorting Options

File Information Display

Safe File Operations

Installation

Via Composer

Manual Installation

  1. Copy the SortingMigration.php command to your Laravel project
  2. Register the command in your app/Console/Kernel.php:

Usage

Basic Command

Interactive Controls

Universal Controls

Navigation Controls

Linux/macOS:

Windows:

Sorting Shortcuts

Sorting Directions

When using automatic sorting, you'll be prompted to choose:

Ascending Options

Descending Options (Default)

How It Works

File Detection

  1. Scans the database/migrations directory
  2. Identifies all .php migration files
  3. Extracts file metadata (size, modification date)
  4. Displays files in an interactive table format

Drag-and-Drop Process

  1. Navigate to desired file using arrow keys
  2. Press SPACE (or type GRAB) to select file
  3. Navigate to target position
  4. Press SPACE (or type DROP) to place file
  5. Repeat for additional reordering

File Regeneration

  1. Creates timestamped backup in storage/app/migration_backups/
  2. Generates new sequential timestamps starting from current time
  3. Renames all migration files with new timestamps
  4. Preserves original migration class names and content
  5. Shows progress bars for backup and regeneration processes

File Structure

Before Sorting

After Sorting (by Date, Ascending)

Backup System

Automatic Backups

Backup Directory Structure

Safety Features

Confirmation Prompts

Error Handling

Rollback Process

If you need to restore original migrations:

  1. Navigate to the backup directory shown after regeneration
  2. Copy files back to database/migrations/
  3. Remove the regenerated files

Display Information

File Table Columns

Visual Indicators

Technical Requirements

Laravel Version

Dependencies

System Requirements

Troubleshooting

Common Issues

"Directory not found" Error

Solution: Ensure you're running the command from your Laravel project root

"No migration files found" Message

Solution: Create migration files first or check directory permissions

Windows Key Input Issues

Problem: Arrow keys not working on Windows Solution: Use W/S keys for navigation and type full commands

Permission Issues

If you encounter permission errors:

  1. Check file permissions: chmod 755 database/migrations
  2. Verify storage directory access: chmod 755 storage/app
  3. Ensure Laravel has write permissions

Advanced Usage

Custom Base Timestamp

The regeneration process uses the current timestamp as base. Files are given sequential timestamps (base + 0 seconds, base + 1 second, etc.)

Integration with Version Control

  1. Run migration sorting in development environment
  2. Commit the reordered migration files
  3. Team members will receive properly ordered migrations
  4. Backup files are automatically excluded from version control

Contributing

Development Setup

  1. Clone the repository
  2. Install dependencies: composer install
  3. Follow PSR-12 coding standards

Feature Requests

License

This package is open-sourced software licensed under the MIT license. See the LICENSE file for more details.

Support

For issues and questions:


All versions of laravel-migration-sorter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^11.0
nesbot/carbon Version ^2.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 abdullahkaram-dev/laravel-migration-sorter contains the following files

Loading the files please wait ....