for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PragmaRX\Tracker\Vendor\Laravel\Artisan;
class Tables extends Base
{
/**
* Command name.
*
* @var string
*/
protected $name = 'tracker:tables';
* Command description.
protected $description = 'Create the migrations for Tracker database tables and columns';
* Execute the command (Compatibility with Laravel 5.5).
* @return void
public function handle()
$this->fire();
}
* Execute the command.
public function fire()
$files = $this->laravel->make('files');
foreach ($files->files($this->getPackageMigrationsPath()) as $file) {
if (!file_exists($destination = $this->makeMigrationPath($file))) {
$files->copy($file, $destination);
$this->info("Migration created: $destination");
if (isLaravel5()) {
$this->call('optimize');
} else {
$this->call('dump-autoload');
* Get the package migrations folder.
* @return string
protected function getPackageMigrationsPath()
$ds = DIRECTORY_SEPARATOR;
return __DIR__."{$ds}..{$ds}..{$ds}..{$ds}migrations";
* Get the system migrations folder.
protected function getBaseMigrationsPath()
$path = 'database'.DIRECTORY_SEPARATOR.'migrations';
return base_path($path);
return app_path($path);
* Make a full path migration name.
* @param $file
private function makeMigrationPath($file)
return $this->getBaseMigrationsPath().DIRECTORY_SEPARATOR.basename($file);