diff --git a/src/Illuminate/Foundation/Console/VendorPublishCommand.php b/src/Illuminate/Foundation/Console/VendorPublishCommand.php index 037567f53445..78dd9b68a940 100644 --- a/src/Illuminate/Foundation/Console/VendorPublishCommand.php +++ b/src/Illuminate/Foundation/Console/VendorPublishCommand.php @@ -68,6 +68,13 @@ class VendorPublishCommand extends Command */ protected $description = 'Publish any publishable assets from vendor packages'; + /** + * Indicates if migration dates should be updated while publishing. + * + * @var bool + */ + protected static $updateMigrationDates = true; + /** * Create a new command instance. * @@ -341,6 +348,10 @@ protected function createParentDirectory($directory) */ protected function ensureMigrationNameIsUpToDate($from, $to) { + if (static::$updateMigrationDates === false) { + return $to; + } + $from = realpath($from); foreach (ServiceProvider::publishableMigrationPaths() as $path) { @@ -381,4 +392,14 @@ protected function status($from, $to, $type) $to, )); } + + /** + * Intruct the command to not update the dates on migrations when publishing. + * + * @return void + */ + public static function dontUpdateMigrationDates() + { + static::$updateMigrationDates = false; + } }