igonics/laravel-specific-migrate
Larablocks Analysis
igonics/laravel-specific-migrate has no release yet to check Laravel compatibility against.
Recommendation checks
Use with careUse with care: meets 0 of 3 checks.
- No dated releases
- 0 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require igonics/laravel-specific-migrate:dev-master |
|
| PHP: | >=5.3.0 |
| License: | MIT |
| Last Updated: | Mar 2, 2017 |
| Links: | GitHub · Packagist |
Laravel Specific File Migrator
Migrate Specific Migrations
Installation
Step 1. Install using composer
composer require igonics/laravel-specific-migrate
Step 2. Add Service Provider to config/app.php
return [
...
"providers":[
...
IGonics\Migrations\Providers\SpecificMigratorServiceProvider::class,
]
];
Usage
Migrating specific files
php artisan migrate:specific --files="filename_1, filename_2"
Rollback specific files
php artisan migrate:specific-rollback --files="filename_1, filename_2"
Using the specific migrator
Migrating specific files
class MigrateComponent extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'component:migrate';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate Component Schema';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$relativePath = database_path('migrations');
$path = __DIR__.$relativePath;
//var_dump($path);
$files = array_filter(scandir($path), function ($file) {
return preg_match("/\.php/", $file) == 1;
});
$files = array_map(function ($file) use ($path) {
return str_replace([$path, '.php'], '', $file);
}, $files);
//var_dump($files);
$this->call('migrate:specific', [
'--force' => true,
'--path' => str_replace(app_path(), '', $path),
'--files' => implode(',', $files),
]);
}
}
Rolling back specific files
class RollbackComponent extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'component:rollback';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Rollback Component Schema';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$relativePath = database_path('migrations');
$path = __DIR__.$relativePath;
//var_dump($path);
$files = array_filter(scandir($path), function ($file) {
return preg_match("/\.php/", $file) == 1;
});
$files = array_map(function ($file) use ($path) {
return str_replace([$path, '.php'], '', $file);
}, $files);
//var_dump($files);
$this->call('migrate:specific-rollback', [
'--force' => true,
'--path' => str_replace(app_path(), '', $path),
'--files' => implode(',', $files),
]);
}
}
#MIT License Copyright (c) 2016 IGonics
Maintained by
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.